STC_APP / process.php
Presidor1's picture
Create process.php
99c79e7 verified
Raw History Blame Contribute Delete
552 Bytes
<?php
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$id = $_POST['id'];
$action = $_POST['action'];
$status = ($action === 'approve') ? 'Approved' : 'Rejected';
$conn = new mysqli("localhost", "root", "", "stc_db");
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
$stmt = $conn->prepare("UPDATE applications SET status=? WHERE id=?");
$stmt->bind_param("si", $status, $id);
$stmt->execute();
$stmt->close();
$conn->close();
header("Location: dashboard.php");
exit();
}
?>