Fixes registration and login
parent
a0c826ed97
commit
548d05e59e
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
|
@ -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' ) {
|
||||||
|
|
Loading…
Reference in New Issue