Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (isset($_POST['username']) && isset($_POST['password'])) {
- $username = $_POST['username'];
- $password = $_POST['password'];
- } else {
- header('Location: login.php');
- }
- if (!empty($username) && !empty($password)) {
- $user = User::login($username, $password);
- if (!is_null($user)) {
- $_SESSION['currentUser'] = $user; // this is all that "being logged in" really is
- header('Location: index.php'); // success
- } else {
- header('Location: login.php'); // failure
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement