37 lines
770 B
PHP
37 lines
770 B
PHP
<?php
|
|
require_once 'db/config.php';
|
|
|
|
$slug = $_GET['slug'] ?? null;
|
|
|
|
if (!$slug) {
|
|
http_response_code(404);
|
|
echo "Page not found.";
|
|
exit;
|
|
}
|
|
|
|
$stmt = db()->prepare('SELECT * FROM pages WHERE slug = ?');
|
|
$stmt->execute([$slug]);
|
|
$page = $stmt->fetch();
|
|
|
|
if (!$page) {
|
|
http_response_code(404);
|
|
echo "Page not found.";
|
|
exit;
|
|
}
|
|
|
|
include 'header.php';
|
|
?>
|
|
|
|
<div class="container mt-5 pt-5">
|
|
<div class="row">
|
|
<div class="col-lg-10 mx-auto">
|
|
<h1 class="display-4 fw-bold text-center"><?php echo htmlspecialchars($page['title']); ?></h1>
|
|
<div class="mt-4 fs-5">
|
|
<?php echo nl2br(htmlspecialchars($page['content'])); ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<?php include 'footer.php'; ?>
|