Files
cmss-projet/forum-project/delete_article.php
2025-11-01 16:42:38 +01:00

16 lines
268 B
PHP

<?php
require_once 'config.php';
if (!isset($_SESSION['user_id'])) {
header("Location: login.php");
exit();
}
$id = $_GET['id'] ?? null;
$stmt = $pdo->prepare("DELETE FROM posts WHERE id = ?");
$stmt->execute([$id]);
header("Location: index.php");
exit();