Problem with form/captcha Parse error: syntax error, unexpected

Hi all getting a this error message Parse error: syntax error, unexpected ‘}’ in /home/kensing1/public_html/_sendmail.php on line 107

[php]<?php session_start();
if(($_SESSION[‘security_code’] == $_POST[‘security_code’]) && (!empty($_SESSION[‘security_code’])) ) {
// Insert you code for processing the form here, e.g emailing the submission, entering it into a database.
$fromemail=“No-Reply [email protected]”; // change here if you want
$toemail="[email protected]"; // change here if you want
$sub=“Online Feedback”; // change here if you want
$success_page_name=“success.html”;
////// do not change in following

unset($_SESSION['security_code']);

}else { “Sorry, you have provided an invalid security code”;

}

?>

<?php ob_start(); ////// do not change in following if($_SERVER['REQUEST_METHOD']=="POST") $fieldnm_1=str_replace ( array("\n"), array("
"),trim($_REQUEST['fieldnm_1'])); $fieldnm_2=str_replace ( array("\n"), array("
"),trim($_REQUEST['fieldnm_2'])); $fieldnm_3=str_replace ( array("\n"), array("
"),trim($_REQUEST['fieldnm_3'])); $fieldnm_4=str_replace ( array("\n"), array("
"),trim($_REQUEST['fieldnm_4'])); $fieldnm_5=str_replace ( array("\n"), array("
"),trim($_REQUEST['fieldnm_5'])); $fieldnm_6=str_replace ( array("\n"), array("
"),trim($_REQUEST['fieldnm_6'])); $fieldnm_7=str_replace ( array("\n"), array("
"),trim($_REQUEST['fieldnm_7'])); $fieldnm_8=str_replace ( array("\n"), array("
"),trim($_REQUEST['fieldnm_8'])); $fieldnm_9=str_replace ( array("\n"), array("
"),trim($_REQUEST['fieldnm_9'])); $fieldnm_10=str_replace ( array("\n"), array("
"),trim($_REQUEST['fieldnm_10'])); $contentmsg=stripslashes("
$sub
First Name *: $fieldnm_1
Last name *: $fieldnm_2
House name or number *: $fieldnm_3
Address: $fieldnm_4
Address: $fieldnm_5
Address: $fieldnm_6
Post code *: $fieldnm_7
Phone Number *: $fieldnm_8
Email *: $fieldnm_9
Comments : $fieldnm_10
"); //// $headers = "MIME-Version: 1.0 "; $headers .= "Content-type: text/html; charset=iso-8859-1 "; $from=$fromemail; $headers .= "From: ".$from." "; @mail($toemail,$sub,$contentmsg,$headers); header("Location:$success_page_name"); }?>[/php]

You’re seeing the error because you have a closing bracket on the last IF statement but no opening bracket.

You should add an open bracket to this line:
[php]if($_SERVER[‘REQUEST_METHOD’]==“POST”) // add this bracket { here!![/php]

Red. :wink:

Sponsor our Newsletter | Privacy Policy | Terms of Service