By on
prepare("SELECT * FROM posts WHERE slug = ?"); $stmt->execute([$slug]); $post = $stmt->fetch(); } catch (PDOException $e) { die("Error: " . $e->getMessage()); } } if (!$post) { http_response_code(404); $pageTitle = 'Post Not Found'; require_once __DIR__ . '/includes/header.php'; echo "
Sorry, the post you are looking for does not exist.
"; require_once __DIR__ . '/includes/footer.php'; exit; } $pageTitle = $post['title']; require_once __DIR__ . '/includes/header.php'; ?>By on