Eastern Michigan University EMU HOME
About people.emich.edu
Tips & Resources
Print this page

Adding a Feedback Feature

Some people would like to give visitors of their site the option of leaving feedback that gets emailed to the webmaster. There are infinite ways of accomplishing this, and this is one of them. It is a PHP based solution, but does not require any programming skills to use.

The nice thing about this system is that it is very flexible and customizable. It allows the webmaster to add features to the form without changing the script. It supports all common input widgets, such as text areas and fields, drop-down menus, radio buttons, etc. It comes with a full documentation page.

The default installation of the system gives you a plain but functional feedback form. Follow the instructions below to get started with it.

Setting Up & Testing the Form

  1. Download emailform.zip to your desktop.
  2. Unzip, or "extract", the file into a new folder. It contains the following five files.
    • emailform.php is the script itself.
    • emailformREADME.htm is the script documentation.
    • error.htm is the error page.
    • index.htm is the feedback form.
    • thankyou.htm is the page visitors see when they successfully fill the form.
  3. Rename the folder feedback.
  4. Change the email address in the script.
    1. Open emailform.php in a text editor.
    2. At line 13, you'll find $emailaddresses definition.
    3. Replace jdoe@example.com with your email address.
    4. Save & Exit.
  5. Copy the entire feedback folder to the server.
  6. Add link to the feedback folder (for example <a href="feedback/">Send Feedback</a>) to your main page.
  7. Go to your homepage and test the link. It should take you to the feedback form.
  8. Test the form by filling it completely and click Send.
  9. The script is in Test Mode. No message will be sent, but you will be see what would have been sent.
  10. Go back and experiment by leaving fields empty to see how the script behaves.
  11. When you are happy with the script, switch it off Test Mode.
    1. Open emailform.php in a text editor.
    2. At line 10, you'll find $test_mode definition.
    3. Replace true with false.
    4. Save & Exit.
  12. Test the form with both good and bad input to make sure
    1. You receive the email.
    2. You see the success.htm page when the form is successfully filled.
    3. You see the error.htm page when the form is not completely filled.

About Customizing the Form

You probably want to dress up the form to make it fit into the style of your site. Just edit the index.htm file to suit you. You should also replace the stock thankyou.htm and error.htm pages with ones that match your site.

Adding and removing form inputs is easy. For example, to get rid of the letter grade feature, simply remove the corresponding section from the form. Similarly, you can easily add more text areas and other inputs. The script will automatically pick up the changes. Just make sure you name your inputs, replacing spaces with underscores. See the emailformREADME.htm for details.

When making changes to the form, you probably want to switch the script to Test Mode first. It makes testing things a lot quicker and easier.

EMU Home | Contact EMU | Site Map | Directories | Calendars | My.emich | Search