Téléverser les fichiers vers "Admin"
This commit is contained in:
18
Admin/supprimer.php
Normal file
18
Admin/supprimer.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?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;
|
||||
?>
|
||||
Reference in New Issue
Block a user