20 lines
540 B
PHP
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();
|
|
?>
|