File: /home/bigisxfd/public_html/cowork/delete_member.php
<?php $item_object='';
include_once("functions.php");
// Check for GET request and `id` parameter
if ($_SERVER["REQUEST_METHOD"] == "GET" && isset($_GET["id"])) {
$memberId = $_GET["id"];
// Check if member ID is valid
if (is_numeric($memberId)) {
// Attempt to delete the member
if (deleteMember($memberId)) {
// Redirect to `members.php` with a success message
header("Location: members.php?message=success");
exit();
} else {
// Redirect to `members.php` with an error message
header("Location: members.php?message=error");
exit();
}
} else {
// Redirect to `members.php` with an invalid ID message
header("Location: members.php?message=invalid_id");
exit();
}
} else {
// Redirect to `members.php` if `id` is not set
header("Location: members.php?message=missing_id");
exit();
}
?>