Hi wickning1 Thanks for your reply, much appreciated! Do I add this code to the top of my exisiting PHP file? OR Do I have to call it somehow? Here is my new code (it works so I'm hoping that the SPAM stops, comes every 24hours so I will keep you posted I guess, can you tell from looking at the script whether it will work?) [code] <?php //block spam security script foreach( $_POST as $value ){ if(strpos($value,'Content-Type:') !== FALSE ){ mail('
[email protected]','Spammer Bot Attempt on form.php',$_SERVER['REMOTE_ADDR']); exit("{$_SERVER['REMOTE_ADDR']} Has been Recorded. Spam bot attempt"); } } //start building the mail string $msg = "<p><strong>First Name:</strong> $_POST[firstname]</p>"; $msg .= "<p><strong>Surname:</strong> $_POST[surname]</p>"; $msg .= "<p><strong>Phone:</strong> $_POST[phone]</p>"; $msg .= "<p><strong>E-Mail:</strong> $_POST[email]</p>"; $msg .= "<p><strong>Enquiry Type:</strong> $_POST[enquirytype]</p>"; $msg .= "<p><strong>Message:</strong> $_POST[enquiry]</p>"; $msg .= "<p><strong>Where did you find us?</strong> $_POST[findus]</p>"; //set up the mail $recipient = "
[email protected]"; $subject = "Contact Form Submission Results"; $mailheaders = "MIME-Version: 1.0\r\n"; $mailheaders .= "Content-type: text/html; charset=ISO-8859-1\r\n"; $mailheaders .= "From: The my Web Site <
[email protected]> \n"; $mailheaders .= "Reply-To: ".addslashes($_POST['email']); //check the email function checkEmail($email) { if (!preg_match("/^( [a-zA-Z0-9] )+( [a-zA-Z0-9\._-] )*@( [a-zA-Z0-9_-] )+( [a-zA-Z0-9\._-] +)+$/" , $email)) { return false; } return true; } //send the mail mail($recipient, $subject, $msg, $mailheaders); //redirect page $URL="http://www.mysite.com.au/contactus_thanks.html"; header ("Location: $URL"); ?> <html> <title>Thanks for contacting mysite</title> <head></head> <body> </body> </html> [/code]