I have a php code that does not show the footer unless the message is correct and gets sent. If there is an error in filling in the fields the code does not show the footer. I know I have to put an 'else' statement in there, but I have no idea how. If there is any bad code in there please feel free to correct it, I am a PHP idiot....
$ip = $_POST['ip'];
$httpref = $_POST['httpref'];
$httpagent = $_POST['httpagent'];
$visitor = $_POST['visitor'];
$visitormail = $_POST['visitormail'];
$notes = $_POST['notes'];
$phone = $_POST['phone'];
if (eregi('http:', $notes)) {
die ("Do NOT try that! ! ");
}
if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
echo "Please hit the Back buttonPlease Enter a valid e-mail address\n";
$badinput = "Your email was NOT sent\n";
echo $badinput;
die ("
Use browser back button !");
}
if(empty($visitor) || empty($visitormail) || empty($phone) || empty($notes )) {
echo "Please hit the Back button - fill in all fields\n";
die ("
Use browser back button !");
}
THIS IS WHERE I NEED THE STATEMENT TO MAKE IT GO TO THE END AND THEN READ THE FOOTER
$todayis = date("l, F j, Y, g:i a") ;
$phone = $phone;
$notes = stripcslashes($notes);
$message = " $todayis [EST] \n
Message: $notes \n
From: $visitor ($visitormail)\n
Referral : tenerifebusinessinformation \n
";
$from = "From: $visitormail\r\n";
mail("lynne.mb@gmail.com", $subject, $message, $from);
?>
Thank you for expressing your interest in Tenerife Business Information. We look forward to speaking with you and helping you get started on your new or existing project. Below is the information you entered on our form, we will contact you soon. Once again Thank You and we look forward to working with you.
Phone Number:
Message:
", $notes);
echo $notesout; ?>
Return to Home Page