session_start();
if ($_SESSION['authenticated'] != true) {
die("Access denied");
}
?>
Delete user
$action = $_POST['action'];
if ($action == "Delete User" ) {
$usr = $_POST['username'];
$mysqli = new mysqli("localhost", "sienasel_sbxusr", "Sandbox@)!&", "sienasel_sandbox");
$sql = "DELETE FROM ????? WHERE username='$usr'";
$mysqli->query($sql);
if ($mysqli->affected_rows > 0) {
echo ''.$usr. ' was deleted.
Delete Another User
';
die();
}
else {
echo ''.$usr. ' was not found.
Delete Another User
';
die();
}
$mysqli->close();
}
?>