Файл read_post.php <?php require ‘db_connect.php’; $slug = trim($_GET[‘slug’] ?? »); if ($slug === ») { http_response_code(404); echo ‘Статья не найдена’; return; } // Подготовленный запрос — защита от SQL‑инъекций $sql = ‘SELECT id, title, slug, content, meta_description, is_published, created_at FROM posts WHERE slug = ? AND is_published = 1’; $stmt = mysqli_prepare($connection, $sql); […]
