delete stations

This commit is contained in:
2022-06-17 20:05:59 +02:00
parent 0f6492ec46
commit 3bea28c125
4 changed files with 43 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
<?php
session_start();
include("../scripts/connection.php");
include("../scripts/functions.php");
$user_data = check_login($con);
if($_SERVER['REQUEST_METHOD'] == "POST") {
try {
$stmt = $con->prepare("DELETE FROM Station WHERE s_id = :s_id");
$stmt->execute(['s_id' => $_POST['s_id']]);
} catch(PDOException $e) {
handle_pdo_exception($e);
}
}
$con = null;
header("Location: stationen.php");
die;
?>