Hi, I really don't know much about php code and need help. Could you tell me what I need to add to this email form php code to stop spammers from email header injection? My hosting account recently was sending spam emails that I did not send and I thought this might be the problem. Thanks.
Here is what I have now:
<?php $to = "email@mydomain.com"; $subject = "Pottery Question"; $email = $_REQUEST['email'] ; $name = $_REQUEST['name'] ; $questions = $_REQUEST['questions'] ; $spam = $_REQUEST['spamcheck'] ; { if ($spam == 4){ $message .= "Name: \n"; $message .= $name; $message .= "\n"; $message .= "\n"; $message .= "Email: \n"; $message .= $email; $message .= "\n"; $message .= "\n"; $message .= "Questions: \n"; $message .= $questions; $headers = "From: $email"; $sent = mail($to, $subject, $message, $headers) ; if($sent) {print "Your message was sent successfully"; } else {print "We encountered an error sending your mail"; } } else {header( "Location: http://www.go.away" ); die();} } ?>