In the 33 lines of code, apparently line 32 has an issue:
“Parse error: syntax error, unexpected ‘}’, expecting ‘,’ or ‘;’ in /home/public_html/wr/form_handle.php on line 32”
Any help will be appreciated to resolve the issue. Thanks
<?php
$mailto = 'email@email.com';
$mailsubj = "Contact Form submission";
$mailhead = "From:CForm\
";
$mailbody = "--- Contact form results ---\
";
foreach($_REQUEST as $key => $value)
{
if($key != 'PHPSESSID')
{
$mailbody .= $key.": ".$value."\
";
}
}
$continue = true;if(isset($_POST['ans']) && $_POST['ans']!='hot')
{
echo 'Wrong answer!'; $continue = false;
}
// if the check box is not checked it will not appear in the $_POST values, it's better to use isset rather than emptyif(isset($_POST['agree']))
{
echo "If you agree with the terms, check the Agree check box";
$continue = false;
}
if($continue)
{
$mailbody .= date('Y-m-d H:i:s',strtotime("now"));
mail($mailto, $mailsubj, $mailbody, $mailhead);
echo "<h2>Thanks!</h2>"
//print_r($_REQUEST);
[B]}[/B]?>