A22.0004 Computers in Principle and Practice II
New York University: Spring 1999

Nathan Hull

Assignment 7 (Extra Credit)
Due: Day of the Final, May 6th


In this final exercise, you will modify "Matt's Guestbook" so that it records a cookie on the user's hard drive.

The first time a user accesses the addguest function, instead of reaching a plain html file, it should call a cgi script which checks to see if a cookie is present. If it is not, it should display a "Welcome New Guest" page along with a blank form.

On subsequent visits to the addguest function, an html page should be generated which greets the visitor by name, and prints out the number of times they have posted information. The cgi script should also fill out as much as form as possible -- basically all information except for the comment itself.

Feel free to change the field names on the form if it suits you.

Make certain that you set not only the domain but also the path of the cookie so that your code will work independently of everyone else's on acf5!

If you prefer, your program may use JavaScript to set and read the cookie instead of perl/cgi.

In addition to posting your work on your web site and providing a link to it, e-mail a copy of the cgi program (or programs) to the grading account at pnp2@cs.nyu.edu. (Note that on some of the assignment pages this e-mail address was incorrectly written as pap2 rather than pnp2!)


Load your pages up to the ACF5 server using the FTP client of your choice (Fetch, etc.) So that you do not have to destroy the look of your ACF5 Home Page, this assignment will use the following naming scheme for the first page:

assign7.html

Thus, the URL for looking at your page (presuming that you have User ID "abc1234") would be:

http://acf5.nyu.edu/~abc1234/assign7.html


And, as usual, when your Web Page(s) for your assignment have been posted, please notify us at:

pnp2@cs.nyu.edu

In the Subject field of your message, please put the assignment number you are turning in.