Getting Info Back From Your Forms - Self Managed Websites


The standard accepted way of getting info back from your forms is to use the formsMail CGI script. To use this you must set the method of your form to post and the action of your form to
  http://www.outfitters.com/cgi-bin/formMail.pl
A few of our hosted sites also support a shortened version for the form's action:
  /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">
We highly recommend you include the referer field containing the URL of the page containing your form. Although forms will work for most visitors without this field, visitors who block referer information will receive an error message when submitting the form if you omit the referer field. For example:
  <input type="hidden" name="referer" value="[insert your URL here]">
as in this example:
  <input type="hidden" name="referer" value="http://www.outfitters.com/~info/forms.html">
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:Name1,Name2,...,NameN
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.
referer
URL of the page containing the form - 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@outfitters.com
<form method="post" action="/cgi-bin/formMail.pl">
	<input type=hidden name=recipient value="nobody@outfitters.com">
        <input type="hidden" name="referer" value="http://www.outfitters.com/~info/forms.html">
	Email: <input type=text name=Email 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:

Email:
City:
State:
ZIP:

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@outfitters.com">
	<input type=hidden name=subject value="Info from form">
	<input type=hidden name=title value="Infobahn Outfitters' 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.outfitters.com/~info/forms.html#Example2">
	Email: <input type=text name=Email 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:

Email:
City:
State:
ZIP:

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@outfitters.com">
	<input type=hidden name=redirect value="http://www.outfitters.com/~info/done.html">
	Email: <input type=text name=Email 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:

Email:
City:
State:
ZIP:


Contact Infobahn Outfitters, Inc.
© Copyright 1996-2008 Infobahn Outfitters, Inc.