|
Putting A Form On My Web Page.
The mail-form.cgi is a program that sends the contents of a web page form to a specified email address. It is designed to be very flexible, yet very simple to use. Besides the basic usage, there are several advanced options available. The simplest implementation of this form only needs one required field to be supplied: email_to, which is the email address of the recipient. There are also several optional fields that will make your email appear more customized. Here is a list of the basic fields:
- email_to
The recipient's email address. This field is always required, and must belong to a Storm customer (eg. support@storm.ca)
- email_to_name
The recipient's name. Example: John Smith
- from_email
The sender's email address. This can be implemented as a hidden field so that it always shows as being sent from the same person. You can also allow the web surfer to input his/her email address here. Example: jdoe@storm.ca
- from_name
The sender's name. Example: Jane Doe
- subject
The subject of the email. Example: Results of Web Feedback Form
- thanks_html
After submitting your form, the web browser will display the web page defined by this URL. Example: http://www.storm.ca/~support/thanks.html It is up to the web page designer to create a valid web page to point to. If you do not supply this field, the mail script will simply display all submitted fields and their contents in a table.
- return_name
This is the name of the web page you wish to link back to after a form is submitted. For example, John Smith's Home Page. If you use this field, you must also specify the return_url field.
- return_url
This is the URL of the web page you will link back to, for example: http://www.storm.ca/~support/. Used in combination with the return_name field, you will get something like this at the end of the generic submitted value table:
Return to John Smith's Homepage
NOTE: When using these fields, you must type them exactly as shown above. Make sure you enter them in lowercase letters.
Your form's action must point to: http://www.storm.ca/cgi-bin/mail-form.cgi.
Click here for examples of how to use the mail form.
Advanced Options
This mail form script allows you to specify a list of required fields that a user must fill in. If one or more of these fields is not entered, the user will receive an error message saying that he/she did not fill in all fields. To specify the required fields, create a new hidden field called required_fields and fill it with a comma-separated list of fields. You can also create a hidden field called error_html, which will redirect the web browser to a specified page when a requirred field is not filled in. If error_html is not specified, the user will simply be given a list of required fields and told to fill them all in. Summary of required fields:
- required_fields
This is a comma-separated list of required fields. For example:
<input type=hidden name="required_fields" value="name,age">
This will force the user to enter his/her name and age. Please note that it is important that the list of fields is separated by commas, with no spaces or other characters before or after the commas.
- error_html
When someone misses a required field in your form and you have an error_html file specified, the web browser will be directed there. For example:
<input type=hidden name="error_html" value="http://www.storm.ca/~support/error.html">
If you have any problems with this page, send an email to support@storm.ca
|
|