JeuPistesSarreguemines/article.php
2023-06-27 14:31:55 +02:00

46 lines
1.1 KiB
PHP

<?php
require_once "require/base.php";
$article = array();
$database = new Database();
if (isset($_GET["id"])) {
$stmt = $database->pdo_article->prepare("SELECT * FROM article WHERE id == :id");
$stmt->bindValue(":id", htmlspecialchars($_GET["id"]));
$stmt->execute();
$article = $stmt->fetch();
}
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<?php
require_once $rq_path . "head.php";
?>
<title><?= $tr["tab_title"]["article"]?></title>
</head>
<body>
<header>
<?php
require_once $rq_path . "nav.php";
?>
</header>
<main>
<header>
<h1><?= $article["title"] ?></h1>
<p><?= $article["summary"] ?></p>
</header>
<article>
<img src=<?= $article["cover_path"] ?> alt=<?= $article["cover_alt"] ?>>
<p><?= $article["content"] ?></p>
</article>
</main>
<footer>
<?php
require_once $rq_path . "footer.php";
?>
</footer>
</body>
</html>