Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/glacials/cins548. Our group project for CINS 548
Something went wrong. Try again.
123456789101112131415161718192021222324252627<?php/* * This page will authenticate users and create session variables, that tells * the webapp that the user is authenticated, and they are allowed to browse to * other pages. Input will be given via a POST from the login.html page. */
require_once 'autoload.php';
//session_start();
$db = new Database;
$user = $db->verify_creds($_POST['email'],$_POST['password']);
if ($user) { $_SESSION['user'] = $user; $_SESSION['cart'] = array(); // An array of product_ids. $_SESSION['notice'] = 'Successfully logged in.'; header('Location: ?');} else { $_SESSION['error'] = 'Invalid user credentials, please try again.'; header('Location: ?login');}
?>