This commit is contained in:
Flatlogic Bot 2025-10-20 23:32:41 +00:00
parent 3ba44cb90a
commit 98aa2e3c0c

View File

@ -17,15 +17,14 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$stmt->execute([$username]); $stmt->execute([$username]);
$user = $stmt->fetch(); $user = $stmt->fetch();
<?php if ($user && password_verify($password, $user['password'])) {
if (password_verify($password, $user['password'])) { $_SESSION['user_id'] = $user['id'];
$_SESSION['user_id'] = $user['id']; $_SESSION['username'] = $user['username'];
$_SESSION['username'] = $user['username']; header('Location: index.php');
header('Location: index.php'); exit;
exit; } else {
} else { $error = 'Nome de usuário ou senha inválidos.';
$error = 'Nome de usuário ou senha inválidos.'; }
}
} catch (PDOException $e) { } catch (PDOException $e) {
$error = 'Database error: ' . $e->getMessage(); $error = 'Database error: ' . $e->getMessage();
} }