36952-vm/delete_property.php
Flatlogic Bot 76d7d99142 PMS 1
2025-12-15 01:31:18 +00:00

23 lines
451 B
PHP

<?php
require_once 'session.php';
check_admin();
require_once 'db/config.php';
$id = $_POST['id'] ?? null;
if (!$id) {
header('Location: properties.php');
exit;
}
try {
$db = db();
$stmt = $db->prepare("DELETE FROM properties WHERE id = :id");
$stmt->bindParam(':id', $id, PDO::PARAM_INT);
$stmt->execute();
} catch (PDOException $e) {
die("DB ERROR: " . $e->getMessage());
}
header('Location: properties.php');
exit;
?>