db::escape($email) ]); if(!$user) throw new Exception("Account not found."); if(!password_verify($password, $user->password)) throw new Exception("Password is incorrect."); $_SESSION["user_id"] = $user->id; Core::addAlert("success", "Log in successful."); HTTP::redirect("/account"); } catch(Exception $e) { Core::addAlert("danger", $e->getMessage()); } } View::includeOnce("header", compact("page_title")); View::include("log_in"); View::includeOnce("footer"); ?>