quelque amelioration

This commit is contained in:
2025-11-02 23:20:42 +01:00
parent 26c06eae90
commit 296b5c5a62
19 changed files with 461 additions and 328 deletions

View File

@@ -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';
}
}
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8"><title>Connexion</title>
<link rel="stylesheet" href="styleco.css">
<meta charset="UTF-8">
<title>Connexion</title>
<link rel="stylesheet" href="stylelog.css">
</head>
<body>
<h1>Connexion</h1>
<form method="post">
<input type="text" name="login" placeholder="Login" required><br>
<input type="password" name="password" placeholder="Mot de passe" required><br>
<button type="submit">Se connecter</button>
</form>
<p style="color:red;"><?= $error ?></p>
<?php if ($error): ?>
<p style="color:red;"><?= htmlspecialchars($error) ?></p>
<?php endif; ?>
</body>
</html>