\n"; echo "

"; Echo $pagetitle; echo "

"; /* All form fields are automatically passed to the PHP script through the array $HTTP_POST_VARS. */ /* Leave this alone - it is how the form will communicate with this program */ $fromemail = $HTTP_POST_VARS['email']; $subject = $HTTP_POST_VARS['subject']; $emessage = $HTTP_POST_VARS['emessage']; $capcha = $HTTP_POST_VARS['capcha']; $cc = (date("d") * 22 + 6) ; /* Simple Captcha calc */ $message = ""; /* an error or success message */ /* Validation is simple Here */ if ($email == "") { $message = "All Fields are Required to Send us a Message."; } else { if (!preg_match("/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/", $email)) { $message = "Error This Email Address Looks Invalid"; } elseif ($cc != $capcha) { $message = "The Captcha Code Must Match"; } elseif ($subject == "") { $message = "Enter a Subject"; } elseif ($emessage == "") { $message = "Enter of message"; } } if ($message == "") { // SEND THE MESSAGE HERE $headers = "From: ".$fromemail . "\r\n"; $sentmessage = "Message sent from .".$ip."\n ".$emessage; $subject = "EaseFeeds.com Contact ".$subject; // SIMPLE USE OF MAIL PHP FUNCTION $mailsent = mail($toemail, $subject, $sentmessage, $headers); if ($mailsent) { $message = "Thanks for Your Email!"; } else { $message = "Problem with Contact Form" ; } } /* ** End Save RSS Feed Details ** */ /* form Here */ $final_html .= ""; /* Close Left Column With Form */ /* Right side of Page - YOu can change this to work for your website if you want*/ $final_html .= "
\n"; $final_html .= "\n"; $final_html .= "
Contact Us Here!
".$message."
"; $final_html .= "
\n"; $final_html .= "Your Email
Your Valid Email Required
\n"; $final_html .= "Subject
Your Email Subject
\n"; $final_html .= "Message
\n"; $final_html .= "Your message to us.
\n"; $final_html .= "Enter This: ".$cc."
Checking for Humans
\n"; $final_html .= "

"; $final_html .= "

"; $final_html .= "
From PHP Scripts for Free"; /* Leave This as courtesy */ $final_html .= "
"; $final_html .= "
\n"; $final_html .= "

It is Simple To Capture Emails and Messages with PHP

"; $final_html .= "You can download the demo of this form at"; $final_html .= " How To PHP."; $final_html .= " This form simply sends an email to the specified TO address embedded in the script. A slightly "; $final_html .= "more complex form may store the information in a database or in a flat file. We chose to offer the "; $final_html .= "the beginner script like this so you could just understand the basics without worrying about security, file handling, "; $final_html .= "or database calls"; $final_html .= "

Making the Page Prettier

"; $final_html .= "You can change the header or beginning body of the statement to make the html pretty or add your custom headings"; $final_html .= " A slightly more sophisticated versin of the same script is used at "; $final_html .= " Easy Rss Feeds Contact Form . I did not add this beccause I wanted to keep the coding simple and flexible."; /* End of Right Side Text */ $final_html .= "
\n"; /* close right side and table */ echo $final_html; // CLOSE HTML echo ""; ?>