35370-vm/delete-dependent.php
Flatlogic Bot 275165284b 1.0
2025-10-31 00:13:36 +00:00

23 lines
487 B
PHP

<?php
declare(strict_types=1);
ini_set('display_errors', '1');
error_reporting(E_ALL);
require_once __DIR__ . '/auth.php';
require_once __DIR__ . '/db/database.php';
if (!isset($_GET['id'])) {
header('Location: index.php');
exit;
}
$dependent_id = (int)$_GET['id'];
$pdo = get_db_connection();
$stmt = $pdo->prepare('DELETE FROM dependents WHERE id = ?');
$stmt->execute([$dependent_id]);
header('Location: index.php?success_message=Dependent deleted successfully');
exit;