Writing to Files
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.
In order to create this guestbook, we are going to create 3 files in the perltour folder.
If you use a cgi-bin, the guestbook.cgi program will eventually go there.
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.
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.
<TITLE> My Guestbook Page </TITLE>
<H1 ALIGN='CENTER'> Please sign our guestbook </H1>
<TR><TD> First Name <TD> <INPUT TYPE=TEXT NAME="first"