It still won't work
It will send me an email, but gives me this!
Parse error: syntax error, unexpected T_ELSE in /home/robolexa/public_html/hfhbeauco.org/contact.php on line 35
http://www.hfhbeauco.org/Volunteer.html
Code:
<?php
$to = $REQUEST['krobol@yahoo.com'];
$from = $REQUEST['Email'];
$name = $REQUEST['Name'];
$headers = "From: $from";
$subject = "Web Contact Data";
$fields = array();
$fields["Name"] = "Name";
$fields["Company"] = "Company";
$fields["Email"] = "Email";
$fields["Phone"] = "Phone";
$fields["list"] = "Mailing List";
$fields["Message"] = "Message";
$body = "We have received the following information:\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$REQUEST[$a]); }
$headers2 = "From: kenr@beaufortccc.edu";
$subject2 = "Thank you for contacting us";
$autoreply = "Thank you for contacting us. Somebody will get back to you as soon as possible, usualy within 48 hours. If you have any more questions, please consult our website at www.hfhbeauco.org";if($from == '')
if($from == '')
{
print "You have not entered an email, please go back and try again";
}
else
{
if($name == '')
{
print "You have not entered a name, please go back and try again";
}
else
{
$send = mail($to, $subject, $body, $headers);
$send2 = mail($from, $subject2, $autoreply, $headers2);
if($send)
header("Location: http://www.hfhbeauco.org/thankyou.html");
}
else
{
{
print "We encountered an error sending your mail, please notify krobol@yahoo.com";
}
}
}
if($from == '')
{
print "You have not entered an email, please go back and try again";
}
else
{
if($name == '')
{
print "You have not entered a name, please go back and try again";
}
else
{
$send = mail($to, $subject, $body, $headers);
$send2 = mail($from, $subject2, $autoreply, $headers2);
if($send)
header("Location: http://www.hfhbeauco.org/thankyou.html");
}
else
{
{
print "We encountered an error sending your mail, please notify krobol@yahoo.com";
}
}
}