first commit
This commit is contained in:
34
admin/login.php
Normal file
34
admin/login.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
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';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8"><title>Connexion</title>
|
||||
<link rel="stylesheet" href="styleco.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>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user