How to Create an Email Feedback Form in PHP/HTML
If you're a webmaster, then you know that it's essential to maintain seamless contact with your site's visitors. One way to do this is through the use of feedback forms placed on your site. These forms allow visitors to submit questions and comments that can be forwarded to the email address of your choice. Creating feedback forms in PHP or HTML format can be quite easy. Just follow a few simple steps.
Things You'll Need
- Web host that uses PHP 4.1 or greater
- Microsoft Notepad or some other ASCII text editor
Instructions
-
-
1
Open your Notepad text editor and paste this code into the
section of an HTML file: -
2
Save this file as "feedback.html."
-
-
3
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" );
?> -
4
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.
-
5
Name this file "sendmail.php" and save it.
-
6
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.
-
1
Comments
-
ishtiakj
Nov 17, 2009
undefined -
kudean
Jun 05, 2009
undefined -
kudean
Jun 05, 2009
undefined