Files
spamhasi/api/opfer/delete.php
marc-go 58b5af9e7e feat: Add user edit modal and user management pages
- Implemented user edit modal in user_edit.html for editing user details.
- Updated sidebar.html to correctly reflect active states for Users and Settings.
- Created table-07.html for displaying user data in a structured format.
- Added settings.html for managing email content and configurations.
- Developed users.html for listing all users with functionality to add and edit users.
2026-04-27 19:00:06 +02:00

30 lines
560 B
PHP

<?php
require "../api.php";
$api = new spamhasiApi();
if (!$api->checkAuth()) {
header("Location: /index.html?status=500&error=Unauthorized");
exit;
}
if (!isset($_POST["id"])) {
die('{"status":500, "error":"Missing fields"}');
}
$id = intval($_POST["id"]);
$db = $api->getDB();
$sql = "DELETE FROM opfer WHERE id = :id";
$stmt = $db->prepare($sql);
$sql_exec = $stmt->execute([':id' => $id]);
if ($sql_exec) {
header("Location: /index.html?status=200");
}else{
header("Location: /index.html?status=500&error=SQL Error");
}
exit;
?>