Supprimer article-index-css/article.php
This commit is contained in:
@@ -1,22 +0,0 @@
|
|||||||
<?php
|
|
||||||
require 'includes/db.php';
|
|
||||||
include 'includes/header.php';
|
|
||||||
|
|
||||||
if (!isset($_GET['id']) || !is_numeric($_GET['id'])) {
|
|
||||||
die("<h2>Erreur 404 - Article introuvable</h2>");
|
|
||||||
}
|
|
||||||
|
|
||||||
$id = (int) $_GET['id'];
|
|
||||||
$stmt = $pdo->prepare("SELECT * FROM articles WHERE id = ?");
|
|
||||||
$stmt->execute([$id]);
|
|
||||||
$article = $stmt->fetch();
|
|
||||||
|
|
||||||
if (!$article) {
|
|
||||||
echo "<h2>Erreur 404 - Article introuvable</h2>";
|
|
||||||
} else {
|
|
||||||
echo "<h2>" . htmlspecialchars($article['titre']) . "</h2>";
|
|
||||||
echo "<p>" . nl2br(htmlspecialchars($article['contenu'])) . "</p>";
|
|
||||||
}
|
|
||||||
|
|
||||||
include 'includes/footer.php';
|
|
||||||
?>
|
|
||||||
Reference in New Issue
Block a user