Ch17 — Login
Implement the DB login, register, etc. using PDO and the student table
Use phpMyAdmin and the linked SQL code to create the students/passwords table; students.
Adapt the pdo code in Chapter 17 so the site has:
- A login page that logins students with the netid and password from a form. Capitalize the netid and password_hash the password. If the hashed password and netid are in the DB then the students should get access to the restricted/secret pages.
- A register page. At this point anyone can register. You need to create a NETID based on three fields in a form, First, Middle and Last. The form of the NETID is three characters and five digits. It should conform to the CU straregy. Initials if you have a middle name. First initial and two letter from last name elsewise. The NETID should not previusly exist in the database. The php code should create the NETID. A succesful registration should send the user to the login page with the proper NETID already filled into the form.
- Assign an email address.
- A logout page. After logout the user should be forwarded to the login page.
- After logout or before login, access to secret pages should be impossible.