From 2f19e5eb4ecad1989e5776a5cbf61c489ddbd3d1 Mon Sep 17 00:00:00 2001 From: William Date: Wed, 30 Mar 2022 06:52:18 +0000 Subject: [PATCH] Commit --- public/login.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/public/login.php b/public/login.php index e9a4fc0..11b1e08 100644 --- a/public/login.php +++ b/public/login.php @@ -1,5 +1,4 @@ -user->loggedIn) { @@ -7,11 +6,14 @@ if ($app->user->loggedIn) $app->redirect('index.php'); } +$username = (string)filter_input(INPUT_POST, 'username'); +$password = (string)filter_input(INPUT_POST, 'password'); + if ($_SERVER['REQUEST_METHOD'] === 'POST') { - if ($app->user->login($_POST['username'], $_POST['password'])) + if ($app->user->login($username, $password)) { - $app->session->flash("Velkommen {$_POST['username']}!"); + $app->session->flash("Velkommen {$username}!"); $app->redirect('index.php'); } http_response_code(401);