JDT |
John Dixon |
Using PHP to Process a Feedback Form |
||||
|
In this article I explain how to create a simple feedback form, and how to send the data entered on that form to an email address. Two web pages need to be produced to perform this task:
feedback.htm 1. <html> This is the form presented to the web site visitor. There are only three fields, but you could obviously have as many as you wanted to on your own form. When the web site visitor clicks the Send Feedback button, the data entered into the three fields is sent to processData.php. processData.php 1. <?php There are two main areas to this web page: a PHP script at the top and an HTML area at the bottom. The PHP script gets the data from the form and puts them into three variables ($title, $comments, and $from). A subject variable ($subject) is also defined. The PHP mail function processes these variables and generates an email message that is sent to the email address defined in $email. The bit of HTML at the bottom of the web page simply displays a message to the web site visitor after the email has been sent. Author: John Dixon Go back to PHP Tutorials home page Go back to Tutorials home page
|
|
|
|||||
|
© 2007-2009 - John Dixon Technology Ltd |
|||||