to HTML. Forms
By Virtual Mechanics
| Over the last several
weeks I have introduced HTML to those of you with little or
no experience with it. Hopefully you will now be able to recognize
the basics of an HTML page even if you don't understand the
specifics. It would be even better if you were now comfortable
enough to try your hand at a few lines of code yourself.
I will wrap up this introduction to HTML with a brief introduction
to the use of Forms. Technically speaking, Forms go beyond basic
HTML. They are now so extensively used in so many web pages
however, that they are an integral part on any introduction
Forms are used in Web Pages to gather information from visitors.
Anyone that has Surfed the net for even a short while will have
probably attempted to enter information into at least one form.
I say attempted because I am sure a common experience is to
spend ten or more minutes gathering and entering information
into a form only
to loose it all. This happens because you selected the wrong
button, entered the wrong information, or attempted to use the
form while the moon was at its zenith during an odd or even
hour in any month that contains a "u", "a" or "e". Any experienced
surfer knows this is certain to cause a problem.
Love them or hate them, forms are here to stay and apt to continue
having problems for the foreseeable future. The reason is that
many forms contain three separate operations. The first of these
is the HTML that actually displays the form. Here is an example
that will not cause a problem.
<Input Type="text" Name="name" Size="30">
The reason this form is reliable is because it allows you to
enter up to 30 characters of text but it does not do anything
with it. Forms require two additional components to be useful.
The second of these is an Action to take with the form and the
third is a program to process the incoming data. It is this
last one where problems often occur.
Here is a form that actually does something.
<INPUT Type="hidden" NAME="recipient"
<INPUT Type="hidden" NAME="subject" Value="QUESTION">
<INPUT Type="text" NAME="email">
<INPUT Type="submit" VALUE="Submit">
OK, if you look at the source on the Web Page for this example
you will see that it is more extensive than the code here. If
you read last week's newsletter about Tables you should recognize
what is going on. The extra code is used to create a simple
table. Forms are an ideal candidate for tables.
The principle difference between this Form and the previous
example is the Action option in the Form Tag. This will send
the information gathered by the Form to the program formmail.pl.
These are the other two components of a Form which I am sure
most of you have heard of before. The act of transmitting the
Form data somewhere is referred to as CGI for 'Common Gateway
Interface'. Once transmitted, the data must be processed by
a program. This example sends the data to a Perl Script called
"formmail.pl" which will retransmit the user's "Email" address
and "Question" to news@VirtualMechanics.com .
One of the reasons CGI is popular is because it can send data
to almost any program. Perl is the most popular but C, C++ and
others are also often used. It is the program that usually causes
the problems. Most of these programs are custom made for each
form. Alpha and Beta testing is consequently done by the first
visitors to use the form.
In future newsletters I will try to find some interesting forms
that some of you may wish to use on your Web Site. For those
of you that would like to learn more about using forms, here
are a few sites with more detailed information. There are many
Source: "IMS Web Tips" is a weekly news letter for
all web site managers regardless of experience who are looking
for detailed information on creating, maintaining and promoting
their web sites.
To subscribe send an email to firstname.lastname@example.org
or visit www.IMSWebTips.com
for subscription information and a list of past articles.
[an error occurred while processing this directive]