Difficulty: Moderately Challenging
Things You’ll Need:
- Web host that uses PHP 4.1 or greater
- Microsoft Notepad or some other ASCII text editor
Step1
Open your Notepad text editor and paste this code into the section of an HTML file:
Step2
Save this file as "feedback.html."
Step3
Create a new file in Notepad and paste the following code:
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
mail( "yourname@example.com", "Feedback Form Results",
$message, "From: $email" );
header( "Location: http://www.example.com/thankyou.html" );
?>
Step4
Replace "yourname@example.com" with the email address you want to receive the contents of the form and "http://www.example.com/thankyou.html" with the URL for your site. Don't forget to include "thankyou.html" at the end. We will create that file later.
Step5
Name this file "sendmail.php" and save it.
Step6
Create a "Thank You" page in Notepad so your visitor sees something other than the "404/File Not Found" page and save it as "thankyou.html." Your thank you message should look something like this:
Thank you for sending your request. You will be contacted within 24-48 hours with a reply.