Creating the HTML form
When you create the HTML form to use in conjunction with the FormMail.pl script, you can include a number of different fields, some of which are hidden form fields that control the operation of the form.
The following table lists and describes
the different fields you may use in your form. You can create and use additional
form fields as necessary.
|
Field
|
Description
|
|
email
|
Creates a form field for the user to input his or
her email address.
Syntax
<input
type="text" name="email" value="YourEmail"
> Your Email address?
Note that "email"
is a reserved word in the FormMail.pl script and should not be used
as the value of the name attribute.
|
|
env_report
|
Enables you to incorporate environmental variables
(such as user's browser type and domain) in the form.
Valid values:
REMOTE_HOST.
Returns the name of the remote host making the request.
REMOTE_ADDR.
Returns the IP address of the remote host
HTTP_USER_AGENT.
Returns the user's browser type.
REMOTE_ADDR.
Returns the name of the remote host making the request.
Syntax
<input
type="hidden" name="env_report" value="REMOTE_ADDR,HTTP_USER_AGENT"
>
|
|
missing_fields_redirect
|
Enables you to specify a URL to which users will
be redirected if one or more required fields are not completed.
Syntax
<input
type="hidden" name="missing_fields_redirect" value="Back
to Main Page" >
|
|
phone
|
Creates a form field for the user to input his or
her phone number.
Syntax
<input
type="text" name="phone" value="YourPhone"
> Your Phone number?
|
|
print_blank_
fields
|
Enables you to specify whether all fields are to
be included in the return email regardless of whether they have been
completed.
Valid values:
0. False. Blank fields are not included in return
email.
1. True. Blank fields are included in return email.
Syntax
<input
type="hidden" name="print_blank_fields" value="0"
>
|
|
print_config
|
Enables you to specify which of the configuration
variables to include in your return email. By default, no configuration
fields are included.
Syntax
<input
type="hidden" name="print_config" value="email,subject"
>
|
|
realname
|
Creates a field into which the user can input their
real name. The value of this field will also be placed in the From:
line of the message header.
Syntax
<input
type="text" name="realname" value="Your Real
Name" > Your Name?
|
|
recipient
|
Enables you to specify the address to which the
form is to be submitted. Typically, this field is hidden.
Syntax
<input
type="hidden" name="recipient" value="Send
To:" >
|
|
redirect
|
Enables you to redirect the user to a different
URL upon submittal of the form, rather than displaying the default submittal
response. You can also use the field to give the user the ability to
specify the URL to which they want to go after they submit the form.
Syntax
<input
type="hidden" name="redirect" value="redirect
url" >
|
|
required
|
Enables you to specify the fields that must be completed
before the form can be submitted.
Syntax
<input
type="hidden" name="required" value="email,phone"
>
|
|
return_link_title
|
Enables you to specify the text of the link that
will return the user to the page specified by the return_link_url field.
Syntax
<input
type="hidden" name="return_link_title" value="Back
to Main Page" >
|
|
return_link_url
|
Enables you to specify the URL associated with the
return_link_title. If you selected the redirect field, this field will
be disabled.
Syntax
<input
type="hidden" name="return_link_url" value="http://urlhere"
>
|
|
sort
|
Enables you to specify the sort order for the data
included in the return email. You can sort the data alphabetically or
specify a custom sort order. If you do not use this field, the returned
information will be sorted in the order in which the browser sends the
information to the script, which typically is the order in which the
fields appear in the HTML code. To sort alphabetically, use "alphabetic."
To specify a sort order, use "order" and then list the field names in
the proper order, separating each with a comma.
Syntax
<input
type="hidden" name="sort" value="alphabetic"
>
|
|
subject
|
Enables you to specify the text that appears in
the Subject field of the return email. If you do not select this option,
then the text "WWW Form Submission" will appear as the message
subject.
Syntax
<input
type="hidden" name="subject" value="Subject:"
>
|
|
title
|
Enables you to specify the title and header that
appears on the resulting page if you do not specify a redirect URL.
For example, if you want the page that displays immediately after form
submission to be titled "Form Results Feedback" then you would enter
that text as this field's value.
Syntax
<input
type="hidden" name="title" value="Feedback
Form Results" >
|
Regardless of which fields you choose to use in your form, you must ensure that the form's action points to the FormMail.pl script and that the method is "POST" in capital letters:
<FORM
METHOD="POST" ACTION="http://sampledomain.com/cgi-sampledomain/FormMail.pl>
Using the FormMail script with a secure server
If you are using the FormMail.pl script through a secure server, you can place your form anywhere on your Web space however you MUST use the following URL as the action of your form:
https://secureserver/cgi-yourdomain/FormMail.pl
Where secureserver
is the name of your secure server and yourdomain
is your domain name.
If you are not
sure what secure server you should use, contact support@way2host.com.
Sample FormMail code
<form
method="post" name="sample" action="http://www.sampledomain.com/cgi-bin/FormMail.pl">
<input type="hidden" name="subject"
value="Subject:" >
<input type="hidden" name="print_config"
value="email,subject" >
<input type="text" name="youremail"
value="YourEmail" > Your Email address?
<input type="hidden" name="recipient"
value="Send To:" >
<input type="hidden" name="missing_fields_redirect"
value="Back to Main Page" >
<input type="hidden" name="env_report"
value="REMOTE_ADDR,HTTP_USER_AGENT" >
<input type="text" name="phone"
value="YourPhone" > Your Phone number?
<input type="hidden" name="sort"
value="alphabetic" >
<input type="hidden" name="print_blank_fields"
value="0" >
<input type="hidden" name="required"
value="email,phone" >
<input type="hidden" name="title"
value="Feedback Form Results" >
<input type="text" name="realname"
value="Your Real Name" > Your Name?
<input type="hidden" name="return_link_title"
value="Back to Main Page" >
<input type="hidden" name="return_link_url"
value="" >
<input type="hidden" name="redirect"
value="redirect url" >
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form>