Here the whole php page, I have checked everything and I cannot find one missing or out of place bracket, etc (usual things to check with this error. Please help! and thanks
<?php
/* Set e-mail recipient */
$myemail = "myemailishere";
$subject = "RSVP";
/* declare variables */
if ($_POST['submitted']){
$fullname = $_POST['fullname'];
$address = $_POST['address'];
$state = $_POST['state'];
$city = $_POST['city'];
$zip = $_POST['zip'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$guest = $_POST['guest'];
$mEntree = $_POST['mEntree'];
$gEntree = $_POST['gEntree'];
/*Check all form inputs using check_input function */
$fullname = check_input($_POST['fullname'], "Enter your name");
$address = check_input($_POST['address'], "Write a subject");
$state = check_input($_POST['state'], "Please enter 2 letter state abbreviation");
$city = check_input($_POST['city'], "Please enter your city");
$zip = check_input($_POST['zip'], "Please enter your zip code");
$phone = check_input($_POST['phone'], "Please enter your phone number");
$email = check_input($_POST['email'], "Please enter your valid email");
$guest = check_input($_POST['guest'], "Please confirm if you are bringing a guest");
$mEntree = check_input($_POST['mEntree']);
$gEntree = check_input($_POST['gEntree']);
/* If e-mail is not valid show error message */
if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $email))
{
show_error ("E-mail address not valid");
}
if ($fullname==""){
show_error ("Please enter your name");
}
if ($address==""){
show_error ("Please enter your address");
}
if(!preg_match('/^[a-zA-Z0-9 ]*$/i', $address)){
$show_error ("Address can only contain numbers, letters and spaces");
}
if ($city==""){
show_error ("Please enter your city");
}
if (!preg_match("/^\b[a-zA-Z ]+\b$/", $city)){
show_error ("City can only contain letters");
}
if ($state==""){
show_error ("Please enter your state");
}
if (strlen($state)<>2){
show_error ("State can only contain 2 letters; use state abbreviation");
}
if (!preg_match("/^\b[a-zA-Z]+\b$/", $state)){
show_error("State can only contain letters");
}
if ($zip==""){
show_error("Please enter your zip code");
}
if (strlen($zip)<>5){
show_error("Zip code can only contain 5 digits");
}
if(!is_numeric($zip)){
show_error ("Zip code must contain only numbers");
}
if ($phone==""){
show_error("Please enter your phone number");
}
if (strlen($phone)<>12){
show_error ("Phone number can only contain 12 digits");
}
if($guest==""){
show_error ("You forgot to confirm attending guest!");
}
/* Let's prepare the message for the e-mail */
$message = "Hello!
Your rsvp form has been submitted with the following info:
Name: $fullname
Address: $address
State: $state
City: $city
Zip Code: $zip
Phone Number: $phone
Email: $email
Attending Guest: $guest
Main Entree: $mEntree
Guest Entree: $gEntree
End of message
";
/* Send the message using mail() function */
mail($myemail, $subject, $message);
/* Redirect visitor to the thank you page */
header('Location: thankyou.html');
exit();
/* Functions we used */
function check_input($data, $problem='')
{
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
if ($problem && strlen($data) == 0)
{
show_error($problem);
}
return $data;
}
function show_error($myError)
{
?>
<html>
<body>
<b>Please correct the following error:</b><br />
<?php echo $myError; ?>
</body>
</html>
<?php
exit;
}
?>