Home Work Assignment 15 (due 02 Dec 2016)

In this assignment you will create a web interface to student records that are kept in a database. Only authorized persons may access the student records. Create a sub-directory called dbase in your web directory. Change the permissions to 777, i.e.

chmod 777 dbase

The following username and password are kept in a flat file called passwd. Create this file in the sub-directory dbase with the following entries:

laughtonK:asdf23
weynC:pkhj23df
diazA:nm45cg
This file should only have read permissions:
chmod 444 passwd

Manually create this table in your database. STUDENTS with the following data.

STUDENTS
ID LAST FIRST MAJOR GPA
3512 Garcia Jose English 3.29
7617 Zhang Amy Chemistry 2.87
5329 Gupta Avi Economics 3.08
4926 Schwarz Ptolemy Astronomy 2.59
1592 Popper Susan History 3.43

After you have created this table in the database, you will create a web database interface in PHP to access, insert or update the data. Access to the database is only through an authorized login so the first page should read:

Student Records Login
User Name  
Password  
Login Reset
If the user's name and password do not match send the message Login Failed.

If the user successfully logged in, then a page is presented with the following choices:

The choices could be buttons that the users has to click.

The Insert Student Record page has a form with text fields for ID, LAST, FIRST, MAJOR and GPA. The only client side validation that you will be doing is that all the fields have been filled. The ID should be unique but you do not have to do any error checking.

The Update Student Record page will look similar to the Insert page. But here you will only check that the ID and any one other or more text fields have been filled.

The Delete Student Record page will just have a text field for the ID. You will assume that the user will enter a valid ID.

The View Student Record page will have 3 text fields - ID, LAST, and FIRST. You should be able to retreive a student record by ID since they are unique. If only the last name is given then a list of all students having that last name should be displayed. If only the first name is given then a list of all students having that first name should be displayed. The user can enter also both first and last name. In this case a list of all students having that first and last name should be displayed. There should be also be a button on that page with the label View All Student Records. If the user presses this button then all the student records sorted by last name, and first name will be displayed in tabular form.

If the user presses the Logout button then you will display a thank you message. There will be a similar message for the other options at the end.

After you create the database table all access will be through the web using the database interface in PHP. We should see your link before 11 pm on Monday, 28 Nov 2016. You may work on this assignment with a partner but both of you will have separate entries in your index file.