GennaroGiorgiofotoreporter
Contact
You must set-up a valid (to) email address before this contact page will work.'; } if (isset($_POST['contact_submitted'])) { $return = "\r"; $youremail = trim(htmlspecialchars($_POST['your_email'])); $yourname = stripslashes(strip_tags($_POST['your_name'])); $yourmessage = stripslashes(strip_tags($_POST['your_message'])); $contact_name = "Name: ".$yourname; $message_text = "Message: ".$yourmessage; $user_answer = trim(htmlspecialchars($_POST['user_answer'])); $answer = trim(htmlspecialchars($_POST['answer'])); $message = $contact_name . $return . $message_text; $headers = "From: ".$youremail; if (email_is_valid($youremail) && !eregi("\r",$youremail) && !eregi("\n",$youremail) && $yourname != "" && $yourmessage != "" && substr(md5($user_answer),5,10) === $answer) { mail($to,$subject,$message,$headers); $yourname = ''; $youremail = ''; $yourmessage = ''; echo ''.$contact_submitted.'
'; } else echo 'Please enter your name, a valid email address, your message and the answer to the simple maths question before sending your message.
'; } $number_1 = rand(1, 9); $number_2 = rand(1, 9); $answer = substr(md5($number_1+$number_2),5,10); ?>