37237-vm/delete_process.php
Flatlogic Bot 4df1537bcb mvp.2
2026-01-02 11:08:19 +00:00

20 lines
540 B
PHP

<?php
require_once 'db/config.php';
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['id'])) {
$id = filter_var($_POST['id'], FILTER_SANITIZE_NUMBER_INT);
try {
$pdo = db();
$stmt = $pdo->prepare("DELETE FROM processes WHERE id = :id");
$stmt->bindParam(':id', $id, PDO::PARAM_INT);
$stmt->execute();
} catch (PDOException $e) {
error_log("DB Error: " . $e->getMessage());
// Optionally, redirect with an error message
}
}
header('Location: index.php');
exit();
?>