added a redirect when logging in working, removed the useless args for $user->getPassword() in login, and fixed the user class

This commit is contained in:
nolanwhy 2023-02-05 09:46:48 +01:00
parent 3c26911da3
commit 5a83ee91db
2 changed files with 4 additions and 3 deletions

View File

@ -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"];
}
}

View File

@ -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;