19 lines
336 B
PHP
19 lines
336 B
PHP
<?php
|
|
session_start();
|
|
require '../includes/db.php';
|
|
|
|
if (!isset($_SESSION['admin'])) {
|
|
header('Location: connexion.php');
|
|
exit;
|
|
}
|
|
|
|
$id = $_GET['id'] ?? null;
|
|
if ($id) {
|
|
$stmt = $pdo->prepare("DELETE FROM articles WHERE id = ?");
|
|
$stmt->execute([$id]);
|
|
}
|
|
|
|
header('Location: tabledebord.php');
|
|
exit;
|
|
?>
|