From 296b5c5a62b63050e4ee71e32942d70848bc0a1a Mon Sep 17 00:00:00 2001
From: s4msk0
- Annuler de l'anulation
+ Annuler de l'anulation
= $error ?>
+ + += htmlspecialchars($error) ?>
+diff --git a/admin/dashboard.php b/admin/dashboard.php index 9168ac8..89e69cc 100644 --- a/admin/dashboard.php +++ b/admin/dashboard.php @@ -1,6 +1,6 @@ query('SELECT * FROM articles ORDER BY date_creation DESC'); $articles = $stmt->fetchAll(); @@ -23,7 +23,7 @@ $articles = $stmt->fetchAll(); echo htmlspecialchars($_SESSION['user_login'] ?? 'Invité'); ?> - | Se déconnecter + | Se déconnecter
@@ -55,7 +55,7 @@ $articles = $stmt->fetchAll();
diff --git a/admin/login.php b/admin/login.php index f7fbeb0..6692966 100644 --- a/admin/login.php +++ b/admin/login.php @@ -2,33 +2,39 @@ require '../include/db.php'; require '../include/auth.php'; - -// Traite le formulaire de connexion : redirige si identifiants corrects, sinon affiche une erreur $error = ''; -f ($_SERVER['REQUEST_METHOD'] === 'POST') { -if (checikLogin($pdo, $_POST['login'], $_POST['password'])) { - header('Location: board.php'); - exit; -} else { - $error = 'Identifiants incorrects'; -} + +if ($_SERVER['REQUEST_METHOD'] === 'POST') { + $login = isset($_POST['login']) ? $_POST['login'] : ''; + $password = isset($_POST['password']) ? $_POST['password'] : ''; + + if (checkLogin($pdo, $login, $password)) { + header('Location: board.php'); + exit; + } else { + $error = 'Identifiants incorrects'; + } } ?>
-
- + +
+