vertion avec les fichiers oublier

This commit is contained in:
2025-11-04 22:28:07 +01:00
parent 1a5e015663
commit 8351b0638e
6 changed files with 94 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'; ?>