CS 290w
Assignment 5
Guestbook and Simple Counter
Due November 14, 1999 by 11:59 p.m.
Must use the turnin program.
Total Points: 100.
You will write one HTML document (PageA) to handle the guestbook.
You may or may not write another HTML page for the counter.
The choice is yours. The counter may reside and be automatically loaded
on the guestbook page, or it can be loaded on a separate page using a
link from the guestbook page.
You'll also write three Perl Scripts (Perl1, Perl2, and Perl3) for this
assignment.
- (20 pts) PageA will contain a form that allows a visitor to your page
to sign your guestbook. This form will have three fields, a name field, an
email field, and a textarea for comments. You must have one button with which to submit
the data and one button to reset the data on the form. This button will call the first Perl Script (Perl1) detailed next. You
must also have a link on this document that asks the user to view the
guestbook. This link will call the second Perl script (Perl2) detailed below.
- (30 pts.) Perl1 will take the information the user provides from PageA and store that information in a file.
This script must check to make sure that
the user has filled out every field in the form. It must also check that the email entry is a properly
formed email address. If the user does not fill out
every field, or has an improperly formed email address, then, using the print command, write back to PageA
a message stating that every field must be filled out. Do this by using the print command to write
the same form back to the current window, incorporating the message. If each field is filled out,
notify the user that the data has been submitted. Lastly, write
PageA back to the current window in case the user would like to make another entry.
- (30 pts) Perl2 takes the information that is stored in the guestbook file and
prints it for the user to view. Email addresses must be displayed using "mailto". Additonally, print the
dates that guestbook entries were made. And, lastly, to add some
color to the page, print names in a color other than black, and print dates in a color other than
black and other than the color used for the names.The format for the guestbook printed to the browser
must look like the following:
Date:
Name:
Email:
Comments:
Horizontal Rule
Date:
Name:
Email:
Comments:
Horizontal Rule
etc., etc.
- (20 pts) Provide a counter that shows how many hits (visits) have been
made to a page. The counter output can either be automatically loaded
on the guestbook page when the user visits that page,
or it can be displayed on a different HTML page when the user clicks a link.
Perl3 will contain the script that will invoke the counter.