36557-vm/delete_user.php
Flatlogic Bot 08fcb2dae0 0.2
2025-12-01 21:25:15 +00:00

23 lines
464 B
PHP

<?php
session_start();
if (!isset($_SESSION['user_id']) || $_SESSION['role'] !== 'Super Admin') {
header('Location: login.php');
exit;
}
require_once 'db/config.php';
if (isset($_GET['id'])) {
$user_id = $_GET['id'];
$db = db();
$stmt = $db->prepare('DELETE FROM users WHERE id = ?');
$stmt->execute([$user_id]);
header('Location: admin_dashboard.php');
exit;
} else {
header('Location: admin_dashboard.php');
exit;
}
?>