Refonte complète du projet

This commit is contained in:
2025-11-02 19:53:50 +01:00
commit 20df067b19
16 changed files with 326 additions and 0 deletions

18
public/index.php Normal file
View File

@@ -0,0 +1,18 @@
<?php
require_once '../includes/db.php';
require_once '../includes/header.php';
$stmt = $pdo->query("SELECT id, titre, SUBSTRING(contenu,1,150) AS extrait, date_creation
FROM articles ORDER BY date_creation DESC LIMIT 10");
?>
<h2>Derniers articles</h2>
<?php while ($row = $stmt->fetch()): ?>
<article>
<h3><a href="article.php?id=<?= $row['id'] ?>"><?= htmlspecialchars($row['titre']) ?></a></h3>
<p><?= htmlspecialchars($row['extrait']) ?>...</p>
<small>Publié le <?= $row['date_creation'] ?></small>
</article>
<hr>
<?php endwhile; ?>
<?php require_once '../includes/footer.php'; ?>