I have tried over and over, I can't figure this out!
<?php
$Name=$_POST['Name'];
$Email=$_POST['Email'];
$Message=$_POST['message'];
$to="removed@lost.com";
if ($Newsletter != False){
$Future = 'Yes';
} else {
$Future = 'No';
}
$Message="
Name: $Name
E-Mail: $Email
Location: $Dine
Food Quality: $Quality
Decor: $Decor
Table Service: $Table
Bar Service: $Bar
Host/Hostess: $Host
Overall Quality: $Overall
Where did you hear about us?: $Referral
When did you dine with us?: $When
Would you like to recieve further info in the future?: $Future
Comments: $Comments
";
if(mail($to,"New Comments from removed",trim($Message),"From: removed
<removed>\r\n")) {
header("location: removedforreason");
} else {
echo "<h1>Sorry but there is an error. Try again please.</h1>";
}
?>
This works just fine, it emails me etc.. But, I am trying to add this last code snip and it won't work. I created a Div Hidden text box that at the moment has a value set for testing. When I try to put the code in, it doesn't work. It still sends me the email. The way its suppose to work is, if the POST detects a value in the hidden field, it acts as it sent. Way to fool Spambots.
This is the code snip I'm trying to add to the above code.
$email2 = stripslashes($_POST["email2"]);
if (!empty($email2)) {
header("location: pretend_that_email_sent.php");
}
Any help would be really great! 🙂