haha sorry I changed my human validation number to be 10 and not 4, didnt update it.
I have amended to code to look like this and it now works!
Code:
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$to = 'my@email.com';
$subject = 'Hello';
$human = $_POST['human'];
$body = "From: $name\n E-Mail: $email\n Message:\n $message";
$headers .= "From: Website USER <someone_from@mysite.com>";
if ($_POST['submit']) {
if ($name != '' && $email != '') {
if ($human == '10') {
if (mail ($to, $subject, $body, $headers)) {
echo '<p>Your message has been sent!</p>';
} else {
echo '<p>Something went wrong, go back and try again!</p>';
}
} else if ($_POST['submit'] && $human != '10') {
echo '<p>You answered the anti-spam question incorrectly!</p>';
}
} else {
echo '<p>You need to fill in all required fields!!</p>';
}
}
?>
Seems to have sorted it.
Thanks
Bookmarks