How to use the generic form
processor
You must register to use our Generic Form Processor. Contact our sales department for more information.
The
use of outgoing email from the Do-It-Yourself Web! server is a premium
service that can be arranged in advance.
The Generic Form Processor is based on a script originally written by Matt
Wright, with some different features and improved security. You can use the
Generic Form Processor to handle any number of forms and you can configure
it to display differently for each form. The choice of variable names that
you wish to have in your form are entirely up to you with a few exceptions
detailed below.
An example of a form and it's source are here to aid you.
Instructions
Required
Statements
Your form must include the following statement:
<FORM METHOD="POST" ACTION="http://cgi.idirect.com/cgi-bin/forms">
The only absolutely required field is the recipient field. It MUST come
after the FORM statement above and should look like this (replace the email
address with the email address of the intended recipient - make sure that
you have preregistered all recipient names that you wish to use or you will
be presented with an error message.)
<INPUT TYPE="hidden" NAME="recipient"
VALUE="yourname@yourprovider.com">
Remember that UNIX is case sensitive...both the above statements contain
strings that MUST be in the case displayed above. Be sure to close off your
form with the tag when you have finished listing all your fields
Optional Fields
- subject
- The subject field will allow you to specify the subject that
you wish to appear in the e-mail that is sent to you after this form has
been filled out. If you do not have this option turned on, then the
script will default to a message subject: WWW Form Submission
- Method
- If you wish to choose what the subject is:
<INPUT TYPE="hidden" NAME="subject" VALUE="Your Subject">
To allow the user to choose a subject:
<INPUT TYPE="TEXT" NAME="subject">
- email
- This form field will allow the user to specify their return
e-mail address. If you want to be able to return e-mail to your user, you
will require this field.
This will be put into the From: field of the message you receive.
- Method
- <INPUT TYPE="TEXT" NAME="email">
- realname
- The realname form field will allow the user to input their
real name. This field will
also be put into the From: line of your message header.
- Method
- <INPUT TYPE="TEXT" NAME="realname">
- cc
- The cc form field allows you to send a "carbon copy" of the form output
to
another email address along with sending a copy to the recipient. Email
addresses that appear in this field must be preregistered. (To preregister
an email address, simply let our sales department know all of the email
addresses that you wish to authorize as recipients or cc recipients).
- Method
- <INPUT TYPE="TEXT" NAME="cc" VALUE="name@provider.com">
- redirect
- If you wish to redirect the user to a different URL, rather
than having them see the default response to the fill-out form, use this
hidden variable. This allows you to create a custom "Thank You" screen.
- Method
- <INPUT TYPE="hidden" NAME="redirect"
VALUE="http://someplace.com/page.html">
- required
- To force users to fill in certain fields, 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.
- Method
- If you want to require that they fill in the email and phone fields in
your form,
use a syntax like:
<INPUT TYPE="hidden" NAME="required" VALUE="email,phone">
- env_report
- Allows you to have Environment variables included in the
e-mail message you receive after a user has filled out your form. Useful
if you wish to know what browser they were using, what domain they were
coming from or any other attributes associated with environment
variables. The following is a short list of valid environment variables
that might be useful:
REMOTE_HOST - Sends the hostname making a request.
REMOTE_ADDR - Sends the IP address of the remote host making the
request.
HTTP_USER_AGENT - The browser the client is using to send the request.
General format: software/version library/version
- Method
- If you wanted to find the remote host and browser sending the request,
you would put the following into your form:
<INPUT TYPE="hidden" NAME="env_report"
VALUE="REMOTE_HOST,HTTP_USER_AGENT">
- sort
- This field allows you to choose the order in which you wish
for your variables to appear in the e-mail that the forms processor
generates. You
can choose to have the field sorted alphabetically or specify a set order
in which you want the fields to appear in your mail message. By leaving
this field out, the order will simply default to the order in which the
browsers sends the information to the script (which isn't always the
exact same order they appeared in the form.) When sorting by a set order
of fields, you should include the phrase "order:" as the first part of
your value for the sort field, and then follow that with the field names
you want to be listed in the e-mail message, separated by commas.
- Method
- To sort alphabetically:
<INPUT TYPE="hidden" NAME="sort" VALUE="alphabetic">
To sort by a set field order:
<INPUT TYPE="hidden" NAME="sort" VALUE="order:name1,name2,etc...">
- title
- This form field allows you to specify the title and header
that will appear on the resulting page if you do not specify a redirect URL.
- Method
- If you wanted a title of 'Feedback Form Results':
<INPUT TYPE="hidden" NAME="title" VALUE="Feedback Form Results">
- return_link_url
- This field allows you to specify a URL that will appear, as
return_link_title, on the following report page. This field will not
be used if you have the redirect field set, but it is useful if you allow
the user to receive the report on the following page, but want to offer
them a way to get back to your main page.
- Method
- <INPUT TYPE="hidden" NAME="return_link_url"
VALUE="http://web.idirect.com/~yourname/">
- return_link_title
- This is the title that will be used to link the user back to
the page you specify with return_link_url. The two fields will be shown
on the resulting form page as:
<ul>
<li><a href="return_link_url">return_link_title</a>
</ul>
- Method
- <INPUT TYPE="hidden" NAME="return_link_title" VALUE="Back to Main
Page">
(Replace the VALUE tag content with whatever you like)
Changing the appearance of the default
confirmation page
The following fields can be used to change the <BODY> tag of the
default
confirmation screen
- background
bgcolor
text_color
link_color
vlink_color
alink_color
- These fields will change the default values of the <BODY> tag from
the default of <body bgcolor="#0b014b"
background="http://www.idirect.com/graphics/bgcolor.jpg"
text="#eeeeee" link="#00ff00" vlink="#ffff00" alink="#ff0000"> to
whatever you specify.
- Method
- To use a file called image.gif in your root directory as the
background:
<INPUT TYPE="hidden" NAME="background"
VALUE="http://web.idirect.com/~yourname/image.gif">
For a background colour of white:
<INPUT TYPE="hidden" NAME="bgcolor" VALUE="#FFFFFF">
For a text colour of black:
<INPUT TYPE="hidden" NAME="text_color" VALUE="#000000">
For a link colour of red:
<INPUT TYPE="hidden" NAME="link_color" VALUE="#FF0000">
For a visited link colour of blue:
<INPUT TYPE="hidden" NAME="vlink_color" VALUE="#0000FF>
For a active visited link colour of yellow:
<INPUT TYPE="hidden" NAME="alink_color" VALUE="#FFFF00>
Any other fields that you use in your form will be mailed back to you and
displayed on the default confirmation screen if you do not have the redirect
field set. You can use as many fields as you like. You can use either the
POST or the GET method, however the POST method is preferred, especially if
you have a large amount of information to pass to the script.