Update add_incident.php

This commit is contained in:
jakani24
2024-06-20 15:46:50 +02:00
parent c1ef1c703a
commit 3c4d5c69b9

View File

@@ -68,9 +68,22 @@ include "../../../api/php/log/add_server_entry.php"; //to log things
$stmt->execute();
$stmt->close();
//get id of this incident
$stmt = $conn->prepare("SELECT id FROM incidents WHERE description = ?");
$stmt->bind_param("s", $keyword);
$keyword=htmlspecialchars($_POST["keyword"]);
$stmt->execute();
$result = $stmt->get_result();
$row = $result->fetch_assoc();
$incident_id=$row["id"];
$stmt->close();
$conn->close();
//add direcotrys etc
mkdir("/var/www/html/incidents/$incident_id/evidence");
echo '<div class="alert alert-success" role="alert">
Incident added successfully!