![]() |
![]() |
Home FAQ Uses of Perl Perl Lessons The Experience Testing Area Perl Links Guestbook About the Site
|
To get information from someone looking at a homepage to a program on the server, there has to be some way to enter the information. The thing that does this is called forms. Forms are a set of fields, places where information can be entered, that after submission, the information is sent to the server and a program processes it. In this lesson, we will concentrate on the forms and how to make them. First, here is a sample form, in which you would enter your name, and then submit it. Now the explanation: <form></form> : The form tag tells the browser that the enclosed text is a form. You must make sure that you close the form for it to work completely. <...action="cgi-bin/name.cgi"> : The action attribute tells the browser what program will process the information when submitted. <...method="post"> : The method attribute tells the browser how to send the information. There are two methods, get and post. This is not really important now, but you will learn more about this later. <input...> : This tag tells the browser to display an input field so that you can enter text.
<...type="..."> :
The type of input field is important, because each one does a different job. The text type lets you
enter in text, but only into a one line box. The submit type is a button which you press to send the information to
the server and the program named in the action.
Here are the properties for the most important <input...> :
Here are the most important properties for the <...type="..."> inputs:
To use these properties, insert (for example) the name "hello" into the <input> tag. |