This commit is contained in:
No4m
2025-11-02 14:05:02 +01:00
parent 9187f41e17
commit f2b78086dd
13 changed files with 122 additions and 74 deletions

View File

@@ -1,7 +1,6 @@
<?php
global $pdo, $pdo;
require '../include/db.php';
require '../include/authenticator.php';
require '../include/auth.php';
requireLogin();
$errors = [];
@@ -26,23 +25,24 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
}
}
?>
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>Ajouter un article</title>
<link rel="stylesheet" href="/assets/style.css">
</head>
<body>
<h1>Ajouter un article</h1>
<?php foreach ($errors as $e): ?>
<p class="error"><?= htmlspecialchars($e) ?></p>
<?php endforeach; ?>
<form method="post">
<label>Titre<br><input type="text" name="titre" value="<?= htmlspecialchars($titre) ?>" required></label><br>
<label>Contenu<br><textarea name="contenu" rows="10" required><?= htmlspecialchars($contenu) ?></textarea></label><br>
<button type="submit">Publier</button>
<a href="board.php">Annuler</a>
</form>
</body>
<head>
<meta charset="utf-8">
<title>Ajouter un article</title>
<link rel="stylesheet" href="/assets/style.css">
</head>
<body>
<h1>Ajouter un article</h1>
<?php foreach ($errors as $e): ?>
<p class="error"><?= htmlspecialchars($e) ?></p>
<?php endforeach; ?>
<form method="post">
<label>Titre<br><input type="text" name="titre" value="<?= htmlspecialchars($titre) ?>" required></label><br>
<label>Contenu<br><textarea name="contenu" rows="10" required><?= htmlspecialchars($contenu) ?></textarea></label><br>
<button type="submit">Publier</button>
<a href="board.php">Annuler</a>
</form>
</body>
</html>