prepare("SELECT * FROM pages WHERE slug = ?"); $stmt->execute([$slug]); $page = $stmt->fetch(); if (!$page) { http_response_code(404); // You can create a more sophisticated 404 page include 'includes/header.php'; echo "

Sorry, the page you are looking for does not exist.

"; include 'includes/footer.php'; exit(); } // SEO and page metadata $page_title = htmlspecialchars($page['title']); $meta_description = htmlspecialchars(substr(strip_tags($page['content']), 0, 160)); include 'includes/header.php'; ?>