new user management system using ajax
This commit is contained in:
18
sys0-code/api/verify_user.php
Normal file
18
sys0-code/api/verify_user.php
Normal 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();
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user