Your form METHOD should be "POST" or "GET", and the ACTION should
be "/cgi-t/form.cgi". All parameters should be entered in lower case
(i.e. "from", not "From" or "FROM").
Required Parameters
Your form must include the following parameters.
Parameter: |
to (recipient) |
Explanation: |
Stipulates
where your form results will be sent. You would usually make this
a hidden field and enter your main email address. |
Syntax: |
<INPUT TYPE="hidden" NAME="to"
VALUE="you@yourname.com"> |
Parameter: |
from (sender) |
Explanation: |
Stipulates the
originating address of the email. You would usually make this a
hidden field and enter your main email address. |
Syntax: |
<INPUT TYPE="hidden" NAME="from"
VALUE="you@yourname.com"> |
Optional Parameters
Parameter: |
subject |
Explanation: |
Stipulates the subject
text of the email. If
you omit this parameter, your form results will use the default
"WWW Form Submission" message subject. |
Syntax: |
To hardcode the subject:
<INPUT TYPE="hidden" NAME="subject" VALUE="Message Subject">
To allow the user to enter a subject:
<INPUT TYPE="text" NAME="subject"> |
Parameter: |
realname |
Explanation: |
Allows users to enter their
name. This will then appear in in the "From" field of
the email message. |
Syntax: |
<INPUT TYPE="text" NAME="realname"> |
Parameter: |
redirect |
Explanation: |
Stipulates a custom confirmation page
to display once the form has been successfully submitted. If you
omit this parameter,
the script will display a standard "Success" message. |
Syntax: |
<INPUT TYPE="hidden" NAME="redirect"
VALUE="http://www.yourname.com/yourchoice.html"> |
Parameter: |
required |
Explanation: |
Stipulates required
fields. If the user submits the form without completing the
required fields, an error message is displayed identifying the
missing fields, together with a link back to the form. An
alternative to this method is the "missing_fields_redirect"
parameter, which enables you to specify a custom error page. |
Syntax: |
<INPUT TYPE="hidden" NAME="required"
VALUE="field1,field2,etc."> |
Parameter: |
sort |
Explanation: |
Stipulates the sort
order of your form results. Fields can be sorted alphabetically,
or in a specified order. If you omit this parameter, results
will remain in the same order as they appear in the form. |
Syntax: |
To sort alphabetically:
<INPUT TYPE="hidden" NAME="sort" VALUE="alphabetic">
To specify the field order:
<INPUT TYPE="hidden" NAME="sort" VALUE="order:field1,field2,etc."> |
Parameter: |
print_config |
Explanation: |
Stipulates
configuration fields that should be repeated in your message body.
By default, configuration fields (i.e. email, subject, etc.) do
not appear in the message body, as they are already displayed in the
message header. |
Syntax: |
<INPUT TYPE="hidden" NAME="print_config"
VALUE="email,subject,etc."> |
Parameter: |
print_blank_fields |
Explanation: |
Forces empty fields
to be included in form results. If this parameter is omitted,
empty fields will be ignored. |
Syntax: |
<INPUT TYPE="hidden" NAME="print_blank_fields"
VALUE="1"> |
Parameter: |
title |
Explanation: |
Specifies a title for
the default confirmation page if the "redirect" parameter is not
used. |
Syntax: |
<INPUT TYPE="hidden" NAME="title"
VALUE="Confirmation Page Title"> |
Parameter: |
return_link_url |
Explanation: |
Specifies the
URL for the "return_link_title" parameter on the default confirmation page if
the "redirect"
parameter is not used. |
Syntax: |
<INPUT TYPE="hidden" NAME="return_link_url"
VALUE="http://www.yourname.com/yourchoice.html"> |
Parameter: |
return_link_title |
Explanation: |
Specifies the
link text for the "return_link_URL" parameter on the default confirmation
page if the "redirect" parameter is not used. |
Syntax: |
<INPUT TYPE="hidden" NAME="return_link_title"
VALUE="Return to Web Site"> |
Parameter: |
missing_fields_redirect |
Explanation: |
Stipulates a custom
error page to display if required fields have not been completed.
If you omit this parameter,
the script will display an error message identifying the missing
fields, together with a link back to the form. |
Syntax: |
<INPUT TYPE="hidden" NAME="missing_fields_redirect"
VALUE="http://www.yourname.com/yourchoice.html"> |
Parameter: |
background |
Explanation: |
Specifies a
background image to display on the default confirmation page if
the "redirect"
parameter is not used. |
Syntax: |
<INPUT TYPE="hidden" NAME="background"
VALUE="http://www.yourname.com/yourimage.gif"> |
Parameter: |
bgcolor, text_color,
link_color, alink_color, vlink_color |
Explanation: |
Specifies the
background, text and link colors of the default confirmation page if
the "redirect" parameter is not used. Colors should be entered as HEX values. |
Syntax: |
<INPUT TYPE="hidden" NAME="bgcolor"
VALUE="#FFFFFF">
<INPUT TYPE="hidden" NAME="text" VALUE="#000000"> |
Parameters for Writing to a File
Parameter: |
filename |
Explanation: |
Specifies the
name of the file to which your results should be written. Form
results are saved to your "cgi-out" directory, which is one level
above your document root ("htdocs"). ".fileform,txt" will be
appended to the "filename" value, so you do not need to specify a
file extension. |
Syntax: |
<INPUT TYPE="hidden" NAME="filename"
VALUE="yourfilename"> |
Parameter: |
delimited |
Explanation: |
Forces form results to be
written in delimited format. |
Syntax: |
<INPUT TYPE='hidden' NAME="delimited"
VALUE="yes"> |
All fields that are used in your form will be shown on the confirmation page (unless you
use the "redirect" parameter),
and will be either sent by email, or written to the file you specify with
the "filename" parameter.
|