delete stations
This commit is contained in:
20
app/public/delete_station.php
Normal file
20
app/public/delete_station.php
Normal 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;
|
||||
?>
|
||||
Reference in New Issue
Block a user