Week 5 HW
register.php
- When the user registers a new account they will go to the register.php file, when they submit their registered info and the user logs back in
via the login.php file they will be sent to the userhome.php file, when logging out they will be sent to the index file aka the home page.
register.php -> login.php -> userhome.php -> index.php
- This allows the user to confirm that they typed in the correct characters for their chosen password
so when they go to log in their password to log in isn't a mistyped error.
- 'P*Ja@VS32kd4udns%#' . strtolower($username) which is a scramble of random characters to make the
salt longer as well as adds the username.
- sha256
- The username and the hash
- When the user is taken to the userhome.php file else an error pops.
- "Welcome, " . $_SESSION['USERNAME'] .", you are logged into our system."
login.php
- Pops an alert that either notifies the user that there was an error while logging in or
notifies the user that the registration process was successful and that they may log into their new
account.
- The salt is stored in the database.
- Subtract the first 64 characters from the beginning.
- 100,000 times.
- The user is taken to the userhome.php file or the admin.php file depending on their admin status.
$_SESSION['LASTLOGIN'] = date("m-j-Y g:iA", strtotime($rowlast['dl']
- The user gets an error: $msg = "
Incorrect login, please try again!
userhome.php
- The user will be redirected to the login.php page.
- Their last login date, activity count, favorite moves, and watched movies.
logout.php
- session_name returns the name of the current session, session_start starts or continues the current session,
session_destroy stops the current session, require("cfd.php") requires the file cfd.php to exist else
the page will not load, and the fifth line calls the header from the directory.