Getting Info Back From Your Forms
Some Links to Introductory material about writing forms in html
The standard accepted way of getting info back from your forms is to
use the formsMail CGI script. In order to use this you must set the
method of your form to post and the
action of your form to
/cgi-bin/formMail.pl
You must also include a hidden input field named recipient
containing the email address
to receive the email from each form submission. For example:
<input type="hidden" name="recipient" value="SomeUser@Some.Domain.Net">
Other hidden fields besides recipient may also be
used to change the look and feel of the formMail interface. It is very
important that none of the data fields in your form use these names.
Complete list of valid hidden fields
- recipient
- who gets the email (THIS FIELD IS REQUIRED)
- subject
- subject line of email
- email
- email address for From: field of email
- realname
- real name for email
- redirect
- end up at this URL instead of the standard result page
- bgcolor
- background color for standard result page
- background
- background image for standard result page
- link_color
- link color for standard result page
- vlink_color
- vlink color for standard result page
- alink_color
- alink color for standard result page
- text_color
- text color for standard result page
- sort
- allows setting of order of returned fields: this can be either:
- alphabetic
- emailed fields will be sorted alphabetically
- order:Person1,Person2,...,PersonN
- emailed fields will be in the order specified in the list. Do
not leave any spaces around the commas or the colon!
- title
- title of standard result page
- print_config
- for debugging - includes these hidden field values in email message
- return_link_title
- Title for return link on standard result page
- return_link_url
- URL for return link on standard result page - this must be
a fully quallified URL (http://blah/blah/blah.html) - relative
paths are not allowed.
Example 1
This form sends an email address, city, state and ZIP code off to
nobody@abingdon.net
<form method="post" action="/cgi-bin/formMail.pl">
<input type=hidden name=recipient value="nobody@abingdon.net">
Person: <input type=text name=Person size=40><br>
City: <input type=text name=City size=40><br>
State: <input type=text name=State size=20><br>
ZIP: <input type=text name=ZIP size=10><br>
<input type=submit value="Submit Example 1">
</form>
Working Example 1 from above HTML code:
Example 2
This form is just like Example 1 but has lots more bells and whistles:
<form method="post" action="/cgi-bin/formMail.pl">
<input type=hidden name=recipient value="nobody@abingdon.net">
<input type=hidden name=subject value="Info from form">
<input type=hidden name=title value="This is a test of FormMail">
<input type=hidden name=bgcolor value="000000">
<input type=hidden name="text_color" value="FFFFFF">
<input type=hidden name="link_color" value="FFFF00">
<input type=hidden name="vlink_color" value="FF00FF">
<input type=hidden name="alink_color" value="00FFFF">
<input type=hidden name="return_link_title" value="Go Back . . .">
<input type=hidden name="return_link_url" value="http://www.abingdon.net/homepage/forms.html#Example2">
Person: <input type=text name=Person size=40><br>
City: <input type=text name=City size=40><br>
State: <input type=text name=State size=20><br>
ZIP: <input type=text name=ZIP size=10><br>
<input type=submit value="Submit Example 2">
</form>
Working Example 2 from above HTML code:
Example 3
This is an example of a redirected result page. This takes the user
to a specified URL instead of the standard result page.
<form method="post" action="/cgi-bin/formMail.pl">
<input type=hidden name=recipient value="nobody@abingdon.net">
<input type=hidden name=redirect value="http://www.abingdon.net/homepage/done.html">
Person: <input type=text name=Person size=40><br>
City: <input type=text name=City size=40><br>
State: <input type=text name=State size=20><br>
ZIP: <input type=text name=ZIP size=10><br>
<input type=submit value="Submit Example 3">
</form>
Working Example 3 from above HTML code:
|