Fixes registration and login

main
Yasen Pramatarov 2024-06-28 14:50:34 +03:00
parent a0c826ed97
commit 548d05e59e
2 changed files with 2 additions and 2 deletions

View File

@ -11,7 +11,7 @@ class User {
$hashedPassword = password_hash($password, PASSWORD_DEFAULT); $hashedPassword = password_hash($password, PASSWORD_DEFAULT);
$query = $this->db->prepare("INSERT INTO users (username, password) VALUES (:username, :password)"); $query = $this->db->prepare("INSERT INTO users (username, password) VALUES (:username, :password)");
$query->bindParam(':username', $username); $query->bindParam(':username', $username);
$query->bindParam(':password', $username); $query->bindParam(':password', $hashedPassword);
return $query->execute(); return $query->execute();
} }

View File

@ -5,7 +5,7 @@ require 'classes/user.php';
unset($error); unset($error);
try { try {
$db = new Database('../jilo-web.db'); $db = new Database('./jilo-web.db');
$user = new User($db); $user = new User($db);
if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) { if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {