Form Action

Action - The action value gives the browser the location of the script that will process the information from this form. In this case please use: http://secure.datarealm.com/cgi-bin/FormMail.cgi

Method - The method value tells the browser how to pass the information to the script. If the value is set to "post" - the browser will pass the information silently in the background. If the value is set to "get" - the browser will pass the information in the URL. For various reasons it is advised that "post" be used unless "get" is needed for a specific process.

Form Settings

The form settings should be placed directly below the form action line. They allow you to specify exactly how the script will operate. There is only one required element, the rest are optional.

recipient (Required)

This line specifies the email address that will be sent the contents of the form. This is the only required configuration item. The email address/alias used in the recipient field, must use a domain hosted on your account (the domain of an email is the text after the @ symbol). This is required to prevent spammers from using the script to send out spam.

If you want to use more than one address, separate the email addresses with a comma. Replace you@example.com with the email address(es) that you would like to use.

<input type="hidden" NAME="recipient" value="you@example.com">

subject

If you would like to specify the subject of the email that the form sends, use the line below. If you do not use this option, the script will default the message subject to: WWW Form Submission

<input type=hidden name="subject" value="Form Subject">

email

If you want to have the visitor specify their email address, use the line below. This result will be specified in the "From:" field of the email that the form sends.

<input type=text name="email">

realname

If you would like the user to add their name to the email address mentioned above, use the tag below. This result will be shown in the "From:" field of the email the form sends.

<input type=text name="realname">

redirect

If you would like to specify the page that users are redirected to after filling out the form, use the line below. If you do not use this option, the script will use the default confirmation page.

If you would like to require the visitor to fill out certain form fields, use the tag below. place all field names that you want to be mandatory into this field. If the required fields are not filled in, the user will be notified of what they need to fill in, and a link back to the form they just submitted will be provided. If you do not use this option, the user will not be required to fill in any of the items on the form.

missing_fields_redirect

If you want to use a custom error page to indicate when a visitor has not filled out one of the required fields, as opposed to the default, use this tag. If you do not use this option, the script will show the default error page.

env_report

If you would like gather additional information on your visitors, specifically their ISP (REMOTE_HOST), IP Address (REMOTE_ADDR), and Browser type (HTTP_USER_AGENT), use the following tag. If you do not use this option, the script won't record any of this information.

sort

If you want to specify the order that the items appear in the email, this tag can help. It has 2 options, the first will alphabetize the results, the second will sort the results in the specific manner you specify. If you do not use this option, the script will sort the results in the order they appear in the browser.

<input type=hidden name="sort" value="alphabetic">

or

<input type=hidden name="sort" value="order:item3,item1,etc...">

print_config

If you would like the values for the email, realname, and subject printed in the body of the message, you can use this tag to accomplish your goal. If you do not use this option, these values will appear only in the header of the message.

print_blank_fields

If you want all of the form fields to be included in the email, even if they are blank, use this tag. If you do not use this option, the script will not include blank form fields in the email message.

<input type=hidden name="print_blank_fields" value="1">

Form Confirmation Page Variables

This script will automatically generate a form confirmation page for you. The following variables allow you to customize the appearance of that page. If you are going to be using the redirect value, you won't need to set any of these variables.

title

This form field allows you to specify the title and header that appear on the confirmation page.

<input type=hidden name="title" value="Thank you for Signing Up">

return_link_url

This field allows you to specify a URL that will appear, as return_link_title, on the confirmation page.

background

bgcolor

This form field allow you to specify a background color for the confirmation page.

<input type=hidden name="bgcolor" value="#FFFFFF">

text_color

If you would like to specify the text color of the confirmation page, use the tag below. Otherwise the default text color (black) will be used.

<input type=hidden name="text_color" value="#000000">

link_color

If you need to change the default link color from the standard blue, you can use the tag below.

<input type=hidden name="link_color" value="#FF0000">

vlink_color

If you need to change the default visited link color from the standard purple, you can use the tag below.

<input type=hidden name="vlink_color" value="#FF0000">

alink_color

If you need to change the default active link color from the standard red, you can use the tag below.

<input type=hidden name="alink_color" value="#FF0000">

Sample Form

The following is the HTML for a small information request form that mails the results to the sales department, and displays a customized confirmation page. The comments along the way explain every setting:

If you have problems with this form, please make sure to check the form settings for any possible errors. A few common errors, with straightforward fixes, are detailed below.

Nothing happens when the submit button is pressed - Check the form action. Typically when the form doesn't work at all it points to a problem with the form action line. Also check your page for any other form action lines that might be confusing the browser (eg: <form>).

404 File Not Found -There are two possible culprits with this error:

- Incorrect form action. The browser can't find the script to process the result.

- Incorrect redirect value (if it is being used). The browser can't find the page to redirect the visitor to.

Everything appears to work, but the email is never received - Check the entire recipient line. Any little typo can mix up the email address and prevent the mail from being properly delivered.