Perl 101 (part 8) - Putting It To The Test - Visitors Welcome! (Page 3 of 8 )
Next up, a guest book. We're going to create a simple guest book that asks the user to enter three parameters: name, email address and comment.
In order to make things simple for you, we've included the basic HTML code for the form as well.all you need to do is cut, copy and paste into your favourite HTML editor. Good service, huh?
<html>
<head>
<basefont face=Arial>
<title>Guest Book</title>
</head>
<body>
<form action="submit.cgi" method="post">
<center>
<h2>Your Space In My Space</H2>
<table width="600" bgcolor="#D6D6D6" cellpadding="10" cellspacing="5">
<tr>
<td width="300" align="right">Name</td>
<td width="300" align="left"><input type="text" name="name"
size="25" maxlength="25"></td>
</tr>
<tr align="center">
<td width="300" align="right">Email</td>
<td width="300" align="left"><input type="text" name="email"
size="25" ></td>
</tr>
<tr>
<td align="right" width="300">Comments</td>
<td align="left" width="300"><textarea name="comments" cols="25"
rows="3" wrap="virtual"></textarea></td>
</tr>
<tr>
<td colspan=2 align="center" width="600"><input type="submit"
value="Sign My Guestbook"></td>
</tr>
</table>
</div>
</form>
</body>
</html>
As you can see, this form asks the user to enter three
values: Name, Email address and Comments. The ACTION of the form is a CGI script that will accept the values entered into the form and store them in a text file.
This article copyright Melonfire 2000. All rights reserved.Next: The Code... >>
More Perl Articles
More By Vikram Vaswani and Harish Kamath, (c) Melonfire