<?php
require 'config.php';

$slug = $_GET['slug'] ?? '';

$stmt = $pdo->prepare("SELECT * FROM pages WHERE slug = ?");
$stmt->execute([$slug]);
$page = $stmt->fetch();

if ($page) {
    echo "<h1>{$page['title']}</h1>";
    echo $page['content'];
} else {
    echo "Page not found.";
}
?>
