Hi,
I am writing a script so people on my website can contact me but every time I try to run it I get the following error! - Parse error: syntax error, unexpected T_IF in /websites/LinuxPackage04/sa/yn/o2/sayno2carbon.com/public_html/sendmail.php on line 22
I am sure it is something little I have missed but I have been bashing my head against the wall for hours and I just can't work it out! Can someone please help?
A copy of the entire script:
<?
//<!--
//-->
$admin = 'myemail@addresshere' ;
$replymsg = 'Thank you for your email. We will respond shortly if required' ;
$formurl = 'contactus.html' ;
$errorurl = 'error.html' ;
$thankyouurl = 'thankyou.html' ;
$email = $_POST['email'] ;
$comments = $_POST['comments'] ;
$name = $_POST['name'] ;
$sub =$_POST['sub'] ;
$hear =$_POST['hear'] ;
$contact = $_POST ['contact']
if (!isset($_POST['email'])) {
header( "location: $formurl" ); //
}
elseif (empty($email) || empty($name) || empty($contact)) {
header( "Location: $errorurl" );
}
else {
$body = "From: \n$name\n\n E-Mail: \n$email\n\n Reason: \n$contact\n\n Comments: \n$comments\n\n Subscription: \n$sub\n\n Hows did you hear about us: \n$hear" ;
mail( $admin, "Feedback Form Results", $body, "From: $email" );
mail( $email, "Thank you for your email. We will respond shortly if required.", $replymsg , "From: $admin");
header( "Location: $thankyouurl" );
}
?>