<?php
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
    echo "Access Denied";
    exit();
}

include 'config.php';

if(!isset($_POST['Auth']) || trim($_POST['Auth']) == '') {
    echo "Auth is required";
    exit();
}

$sql = "DELETE FROM users WHERE Auth = ?";

$stmt = $conn->prepare($sql);
if ($stmt) {
    $stmt->bind_param("s", $_POST['Auth']);

    if ($stmt->execute()) {
        echo "Deleted Successfully";
    } else {
        echo "Delete Failed";
    }
    $stmt->close();
} else {
    echo "Delete Failed";
}
$conn->close();
?>