new user management system using ajax

This commit is contained in:
Janis Steiner
2024-11-28 07:47:09 +00:00
parent 60d68dae88
commit 69403d7741
8 changed files with 589 additions and 296 deletions

View File

@@ -0,0 +1,18 @@
<?php
session_start();
if (!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true || $_SESSION["role"][3] !== "1") {
header("location: /login/login.php");
exit;
}
require_once "../config/config.php";
$userId = $_POST['userId'];
$sql = "UPDATE users SET banned = 0 WHERE id = ?";
$stmt = $link->prepare($sql);
$stmt->bind_param("i", $userId);
$stmt->execute();
$stmt->close();
?>