From 5a83ee91dbeca97fa568dead2a73e165ba13c68b Mon Sep 17 00:00:00 2001 From: nolanwhy Date: Sun, 5 Feb 2023 09:46:48 +0100 Subject: [PATCH] added a redirect when logging in working, removed the useless args for $user->getPassword() in login, and fixed the user class --- core/classes/user.php | 4 ++-- login.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/classes/user.php b/core/classes/user.php index df6547c..20e34c3 100644 --- a/core/classes/user.php +++ b/core/classes/user.php @@ -17,7 +17,7 @@ class User { public function getMoney($short) { if ($short == "true") { - $money = $this->$query->sqlData["money"]; + $money = $this->sqlData["money"]; if ($money < 1000000) { // Anything less than a million @@ -31,7 +31,7 @@ class User { } } else { - return $this->$query->sqlData["money"]; + return $this->sqlData["money"]; } } diff --git a/login.php b/login.php index b237fa7..a1d190b 100644 --- a/login.php +++ b/login.php @@ -26,8 +26,9 @@ if(isset($_POST['submit'])) { $query->execute(); $result = $query->fetchColumn(); if ($result > 0) { - if (password_verify($password, $user->getPassword($con, $username))) { + if (password_verify($password, $user->getPassword())) { $_SESSION["user"] = $user->getID($con, $username); + header('location: /home'); //echo $_SESSION["user"]; } else { $passwordiswrong = true;