HTML and CSS Reference
In-Depth Information
A CGI script is a program written in a programming language (such as PHP or Perl)
that communicates with the Web server. The CGI script sends the information input on
the Web page form to the server for processing. Because this type of processing involves
programming tasks that are beyond the scope of this topic, the information entered in the
form created in this chapter will be submitted in a file to an e-mail address. The e-mail
address will be specified as the action attribute value in the <form> tag.
The method attribute of the <form> tag specifies the manner in which the data
entered in the form is sent to the server to be processed. Two primary ways are used in
HTML: the get method and the post method. The get method sends the name-value
pairs to the end of the URL indicated in the action attribute. The post method sends
a separate data file with the name-value pairs to the URL (or e-mail address) indicated
in the action attribute. Most Web developers prefer the post method because it is much
more flexible. You need to be cautious when using the get method. Some Web servers
limit a URL's size, so you run the risk of truncating relevant information when using the
get method. The post method is used for the forms in this chapter.
The following HTML code creates a form using the post method and an action
attribute to indicate that the form information should be sent to an e-mail address in an
attached data file:
Mailto Restrictions
Some schools and
organizations restrict the
use of the mailto action.
This is something that you
need to test in order to
determine whether it will
work in your situation.
<form method=”post” action=”mailto:bluwav@isp.com”>
When the form is submitted, a file containing the input data is sent as an e-mail
attachment to the e-mail address bluwav@isp.com.
To Create a Form and Identify the Form Process
The following step enters HTML code to create a form and identify the form process.
1
statement <!--Insert
form method
statement here --> on
line 11.
Highlight the
form statement on line 11
with post to e-mail address
start form
<form
method=”post”
action=”mailto:
bluwav@isp.com”>
to replace the
highlighted statement
with the new tag.
Type
line 36 and press the
e n t e r key.
Click the blank
</form> but do
not press the e n t e r
key (Figure 6-8).
Type
end form
Figure 6-8
 
Search WWH ::




Custom Search