home -- outline -- lectures -- assignments -- discussion -- tips -- links -- | |
![]() ![]() | |
![]() |
Assignment 6: Getting information from visitors
With this assignment you will extent your pages to gather information from people visiting your site. The assignment will have two parts: easy and harder. A Guest Book (Easy): Using the html and scripts from Wednesday's lecture, put a FORM on your top level page that asks for a visitor's name and writes it to a file. The page that is created when this script is invoked should provide a listing of all of the visitors to date. This means that the one script should first write to the file and then read from it. Recall that the file has to be publicly readable and the script must be executable by anybody (chmod). A link recommendation page (Harder): Many sites allow visitors to provide links to pages that are of interest to the visitor. The site then provides this information back to future visitors. You will now provide this functionality on your site. You will provide a link like the one demonstrated in class that calls a script directly using an "A" tag. It will read in and format a file of URLs, comments about them, and ratings. You should format the URLs into "A" tags so that they will be live on the page. The page will also include a FORM that will allow users to add new URLs (using INPUT type=text), comments (using input type=textarea), and ratings from 1 to 10 stars (using a menu built out of SELECTs). The script linked to this form will store this information in a single text file. You will have to figure out how to keep the different entries separate from each other and how to break each entry into its parts for display on the "links" page. This will mean you will have to learn about one more piece of Perl, a function called "split" . But we will tell you about this on Friday. |