Supprimer article-index-css/connexion.php
This commit is contained in:
@@ -1,41 +0,0 @@
|
|||||||
<?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>
|
|
||||||
Reference in New Issue
Block a user