This commit is contained in:
2025-10-27 20:40:46 +01:00
parent 4fc2516bbc
commit 7181ead64e
2 changed files with 29 additions and 3 deletions

0
article.php Normal file
View File

View File

@@ -9,9 +9,35 @@ $stmt->execute();
<!DOCTYPE html>
<html lang="fr" dir="ltr">
<head>
<meta charset="UTF-8">
<title>Blog</title>
<meta charset="UTF-8"> <title>Mon Blog</title>
</head>
<body>
<h1>Mini projet</h1>
<p>Bienvenue . Voici les derniers articles :</p>
<hr>
<?php
while ($article = $stmt->fetch(PDO::FETCH_ASSOC)) :
?>
<article>
<h2><?php print htmlspecialchars($article['titre']); ?></h2>
<p>
<?php
print htmlspecialchars(substr($article['contenu'], 0, 200));
?>...
</p>
<a href="article.php?id=<?php print $article['id']; ?>">Lire la suite</a>
</article>
<hr>
<?php
endwhile;
?>
</body>
</html>