Téléverser les fichiers vers "article-index-css"

This commit is contained in:
2025-11-17 19:15:15 +00:00
parent 009e1d0bcc
commit 72e147e89a
5 changed files with 219 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
<?php
session_start();
require '../includes/db.php';
$message = '';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$login = trim($_POST['login']);
$password = trim($_POST['password']);
$stmt = $pdo->prepare("SELECT * FROM utilisateur WHERE login = ?");
$stmt->execute([$login]);
$user = $stmt->fetch(PDO::FETCH_ASSOC);
if ($user && password_verify($password, $user['password'])) {
$_SESSION['admin'] = $user['login'];
header('Location: tabledebord.php');
exit;
} else {
$message = "Identifiants incorrects";
}
}
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<link rel="stylesheet" href="../style.css">
<meta charset="UTF-8">
<title>Connexion Administrateur</title>
</head>
<body>
<h2>Connexion Administrateur</h2>
<form method="post">
<input type="text" name="login" placeholder="Login" required><br><br>
<input type="password" name="password" placeholder="Mot de passe" required><br><br>
<button type="submit">Se connecter</button>
</form>
<p style="color:red;"><?= htmlentities($message) ?></p>
</body>
</html>