article
This commit is contained in:
0
article.php
Normal file
0
article.php
Normal file
30
index.php
30
index.php
@@ -9,9 +9,35 @@ $stmt->execute();
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="fr" dir="ltr">
|
<html lang="fr" dir="ltr">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8"> <title>Mon Blog</title>
|
||||||
<title>Blog</title>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user