[an error occurred while processing this directive]
For the next section we will create a page which allows the visitor to enter information into a guestbook. Guestbook programs are often preferable to e-mail because the information is stored in a database, which means it can be sorted, filtered, manipulated, and exported.
<SHAMELESS PLUG>
If you do not want to write all the code for adding, deleting, and
modifying data, I have created a database program which you can use
instead. Check out Webteacher's
Webdata - the EASIEST database for the web.
</SHAMELESS PLUG>
In order to create this guestbook, we are going to create 3 files in the perltour folder.
The process is simple. guestbook.cgi is a program which will get the name, address, city, state, zip, phone number, and comments from the web page, and append them as a new line in the guestbook.log file.
To begin with, let's create the HTML page for your visitors to sign
in. This form contains 10 elements, plus a submit button.
Copy this page to your word processor, and name it guestbook.htm
Remember, if your server uses a cgi-bin, you need to add /cgi-bin/ before guestbook.cgi in the <FORM> tag.
When you have created the file, upload it to the perltour folder.
<H1 ALIGN='CENTER'> Please sign our guestbook </H1>
<TABLE BORDER=0 width=100%>
<FORM ACTION="guestbook.cgi" METHOD="post">
<TR><TD> First Name <TD> <INPUT TYPE=TEXT NAME="first"
SIZE=25>
<TR><TD> Last Name <TD> <INPUT TYPE=TEXT NAME="last"
SIZE=25>
<TR><TD> Address <TD> <INPUT TYPE=TEXT NAME="address"
SIZE=40>
<TR><TD> City <TD><INPUT TYPE=TEXT NAME="city" SIZE=25>
<TR><TD>State <TD><INPUT TYPE=TEXT NAME="state" SIZE=2>
<TR><TD>Postal Code <TD><INPUT TYPE=TEXT NAME="postal"
SIZE=9>
<TR><TD> Telephone <TD> <INPUT TYPE=TEXT NAME="phone"
SIZE=25>
<TR><TD> e-mail <TD> <INPUT TYPE=TEXT NAME="email"
SIZE=25>
<TR><TD> Add me to<BR>your mailing list <TD><INPUT NAME="maillist"
TYPE=CHECKBOX CHECKED>
<TR><TD> Comments <TD>
<TR><TD COLSPAN=2><TEXTAREA NAME="comments" ROWS=6 COLS=80></TEXTAREA>
<TR><TD><TD> <INPUT TYPE="SUBMIT" VALUE="Send my comments">
</FORM>
</TABLE>
</BODY></HTML>
On to the Log file. |