<?php
$my_email = "Query'at'smg-computers.com";
if ($_SERVER['REQUEST_METHOD'] != "POST"){exit;}
$message = "";
while(list($key,$value) = each($_POST)){if(!(empty($value))){$set=1;}$message = $message . "$key: $value\n\n";} if($set!==1){header("location: $_SERVER[HTTP_REFERER]");exit;}
$message = $message;
$message = stripslashes($message);
$subject = "SMG Query - " . stripslashes($_POST['Subject']);
$headers = "From: " . $_POST['Email'] . "\n" . "Return-Path: " . $_POST['Email'] . "\n" . "Reply-To: " . $_POST['Email'] . "\n";
mail($my_email,$subject,$message,$headers);
?>
if (strpos($my_email, "Query'at'smg-computers.com")){
echo "<p>A nice error message.</p>";
} else {
//The Email action
}
Bloo_Fish said:
Mr_L said:A bit annoying for just sending an email though.
Al Vallario said:Snip
Lt. Manlove said:The perfect solution to this problem, only human users may use the form.
Al Vallario said:If it's bots that are causing you grief, just add a 'This message is not spam' checkbox, or a 'What colour is an orange?' textbox if you feel like going a bit over the top. If the form doesn't meet the requirements, take them back to the form and give them a snazzy error message
if (isset($_POST['Confirm']))
{
mail($my_email,$subject,$message,$headers);
}
else
{
echo "Please check the tick box confirming your details."?><a href="javascript:history.go(-1)" onMouseOver="self.status=document.referrer;return true"> <br>Back </a><?php ;
exit;
}
Simmy said:yeeeeeah check out my spam free inbox this morning
Good to hear it workedSimmy said:yeeeeeah check out my spam free inbox this morning