Form Tutor- Lesson 1
Just like "follow the bouncing ball", I want you to open up Notepad (Yes Notepad!) and follow me. Copy and paste off this page the following to get you started:
<HTML>
<HEAD>
<TITLE>Joe's the handsomest guy I know</TITLE>
</HEAD>
<BODY>
</BODY>
</HTML>
Save it as form1.html on a floppy disk (Win3.x users save it as form1.htm). Start up your browser [plug Netscape].Use it to open form1.html and run Notepad and the browser side by side. This way you can create your pages and almost instantaneously see the results of your handiwork. If hitting the reload button is not quite resetting everything, hit the reload button while holding down the [Shift] key.
Type in your form tags.
<HTML>
<HEAD>
<TITLE>Joe's the handsomest guy I know</TITLE>
</HEAD>
<BODY>
<FORM>
</FORM>
</BODY>
</HTML>
Next we must tell the browser where to send the data we gather and how to send it. There are two basic things you can do now.
We will indeed be using the first method and so an explanation of CGI (Common Gateway Interface) scripting is necessary before we get into forms.
<IMG
src="http://www.tcf.ua.edu/cgi-bin/counter.exe?width=6&link=203index&style=a">
www.tcf.ua.edu
/cgi-bin/ (short for CGI scripts
and binary, executable files) for
counter.exe, which it then runs.
counter.exe checks to see how many hits this particular page
has had and then assembles GIFs of numbers into the counter image itself.
width=6 means the counter will be six digits wide
link=389sample identifies which page is being counted
style=a selects the style of the numbers
link= with "389" and
then use their last names:
link=389Sorenson
<FORM METHOD="POST"
ACTION="http://www2.tcf.ua.edu/cgi-bin/wsendmail.exe">
Note- Microsoft's Internet Explorer 3.0 does not support mailto forms. When you try to submit the information, the new mail message window pops up. Explorer does however support forms sent to a CGI script.
<HTML>
<HEAD>
<TITLE>Joe's the handsomest guy I know</TITLE>
</HEAD>
<BODY>
<FORM METHOD=POST
ACTION="mailto:xxx@xxx.xxx"
ENCTYPE="application/x-www-form-urlencoded">
</FORM>
</BODY>
</HTML>
This line is very important. The only thing you have to do is plug in your email address after mailto: The rest must be written exactly as shown. The words FORM, METHOD, POST & ACTION do not have to be capitalized but there must be a space between each attribute.. between FORM & METHOD, between POST & ACTION, and between .com" & ENCTYPE.
Unfortunately the data will be sent to you in this 'only useful to a computer' format...
FORMNAME=New+Entrant&NAME=R.U.+Havinfun&ADDRESS=1313+Mockingbird+Lane
&CITY=Beverly+Hills&STATE=CA
What you'll need is a program to turn it into 'useful to a human' format...
FORMNAME=New Entrant
NAME=R.U. Havinfun
ADDRESS=1313 Mockingbird Lane
CITY=Beverly Hills
STATE=CA
Mailto Formatter is an excellent little freeware utility that does this job quite nicely.
The example above illustrates that a form is nothing more than input names (NAME, ADDRESS, etc) paired with input values (R.U. Havinfun, 1313 Mockingbird Lane, etc).The only real variable is how we go about getting the values.
|
| Introduction | Lesson 1 | Lesson 2 | Lesson 3 | Lesson 4 | Lesson 5 | Index |
| PROFESSIONAL WEB DESIGN | ||||||