http://www.ionet.net/form.html (PC Press Internet CD, 03/1996)
HTML Form Tutorial

OK, here's Bill's Quick and Easy Form Tutoral. First, the code for the
form itself. Here's CLASFORM.HTML, the form for our classified ads
submissions.
<pre>
<HTML>
<HEAD>
<TITLE>Classified Submission Form< /TITLE> < /HEAD>
<BODY>
<H1>Internet Oklahoma Classifieds < /H1> <br clear> <hr >
<FORM METHOD="POST"
ACTION="/view-pcpress_n/http://www.ionet.net/cgi-bin/cgiemail/info/clasform.txt">
Date: <INPUT TYPE="text" NAME="Date" size="10"> <P>
Name: <INPUT TYPE="text" NAME="Name" >
Address: <INPUT TYPE="text" NAME="Address" size="30"> <P>
City: <INPUT TYPE="text" NAME="City" >
State: <INPUT TYPE="text" NAME="State" size="2">
ZIP: <INPUT TYPE="text" NAME="ZIP" size="10"> <P>
E-Mail Address: <input type="text" name="Mail" size="40">
<P> <hr> <P>
<CENTER>Headline <BR> <input type="text" name="Headline"
size="60"> < p >
Ad Information <BR> <textarea name="Copy" Rows="4" Cols="60">
< /textarea> <P>
<input type="submit" value="Submit Form">
<input type="reset" value="Reset Form to Defaults">
< /CENTER>
< /FORM>
< /BODY>
< /HTML>
Note that it's a FORM METHOD="POST", and it's executing
the Cgi-BIN script called "cgiemail". The syntax for that command
is:
<FORM METHOD="POST"
ACTION="/view-pcpress_n/http://www.ionet.net/cgi-bin/cgiemail/~username/formtext.txt">
where "~username" is a tilde symbol and your username. The file
"formtext.txt" is the text file that goes along with your form. The
cgiemail program will take the data values from the fields on the
form, and "fill out" the text file, then mail it to you at the email
address specified at the top of the file.
Here's the sample text file that goes with the above form,
CLASFORM.TXT:
From: IONet Classifieds
To: mrbill@ionet.net
Subject: IONet Classified
[Date]
[Name]
[Address]
[City], [State] [ZIP]
[Mail]
[Headline]
[Copy]
When the cgiemail program finds a field in brackets ([]) in the
text file, it looks for a corresponding data value (a "name="
field in the .html file) in the form's HTML code. It then takes
the value that the user entered into the form at that location,
and replaces the "bracketed" value in the text file with that
of what the user entered into the form. The text file is then
mailed to the user specified in the To: line at the top of the
text file.
If you've got any more questions, be sure and let me know.
Bill Bradford
Tech Support
mrbill@ionet.net