COP3832, Spring 2000, Assignment 5
Due Monday 4/3 at the start of class
Do not use JavaScript in this assignment
Create a link on your main server's home page to this script.
Create a script that requires a user to log in. Use the social security number
as the user name. There will be several different pages that will be
displayed by this script:
-
There will be a Log In page that requires the user to enter a social
security number.
-
There will be a Form page that displays the data from the file in
a form that the user can edit. It will be the same form as in assignment
4, without the social security number. There will be a submit button on this
page.
-
There will be a Confirmation page that displays the user's data in
HTML (not in form elements) and allows the user to Confirm that the data
is correct, or allows the user to click an Edit button and return to the
Form page.
-
There will be a Thankyou page that displays all the data that has
been added to the data base. List the social security number as well as all
the other data from the form. All data should be in a nice, readable format.
There will be a button that takes the user to the File page.
-
There will be a File page that displays the entire contents of the
database in a readable format. Also, include a link back to the Log In page,
but do not send a query string to it.
-
Each page should use a different background color, text color and link color.
Each page should have a different title.
Use the following logic in the script:
-
Create a database on the server that uses the social security number as the
index.
-
Require the user to enter a social security number on the Log In page.
If the social security number is not provided, then print a suitable message
on the Log In page and request the social security number again. Write
the valid social security number to a cookie.
-
If there is a cookie with a social security number, then do not display the
Log In page, but go directly to the Confirmation page.
-
If the social security number is not in the data base, then display the
Form page. The user must supply data for all fields. If all the data
is valid, then display the Confirmation page, otherwise redisplay
the Form page with all of the user's data (make it sticky). When
redisplaying the Form page, create an unordered list indicating which
fields need to be corrected, and what is wrong with them. Do not display
a list of invalid fields when the Form page is first displayed. Only
show the invalid fields after the user has clicked the submit button.
-
If the social security number is in the database, then display the
Confirmation page with the user's data.
-
From the Confirmation page, if the user clicks the Confirm
button, then write the new data to the file and display the Thankyou
page. If the user clicks the Edit button, then go back to the Form
page with all the user's data filled in (make it sticky).
-
From the Thankyou page, if the user selects the View File button then
display the File page.