Allows you to register for an account, login, update account information, and log out. If you are not logged in and try to access a page requiring a login, you will be redirected back to the login page.
The code is kind of thrown together, since I was learning this all as I was creating the site.
Requires a table with these fields (to function correctly):
Field | Type | Null | Key | Default | Extra |
id | int(11) | NO | PRI | NULL | auto_increment |
username | char(50) | NO | NULL | ||
char(50) | NO | NULL | |||
first_name | char(50) | YES | NULL | ||
last_name | char(50) | YES | NULL | ||
unsafe_pass | char(50) | NO | NULL | ||
ip | char(45) | YES | NULL | ||
date_created | timestamp | NO | CURRENT_TIMESTAMP | ||
suspended | tinyint(1) | YES | 0 |
Ip is currently unused, and suspended can only be set by directly accessing the database (although the login will check to see if the user is suspended).