diff --git a/add_campsite.php b/add_campsite.php index 73608405..6d2ca28c 100644 --- a/add_campsite.php +++ b/add_campsite.php @@ -4,6 +4,12 @@ require_once("env.php"); session_start(); $user_id = $_SESSION['user_id']; // assuming you're storing it like this +// CSRF Token Validation +if (!isset($_POST['csrf_token']) || !validateCSRFToken($_POST['csrf_token'])) { + http_response_code(403); + die('Security token validation failed. Please try again.'); +} + // campsites.php $conn = openDatabaseConnection(); diff --git a/bar_tabs.php b/bar_tabs.php index fd5faada..7c40ff7a 100644 --- a/bar_tabs.php +++ b/bar_tabs.php @@ -155,6 +155,7 @@ unset($_SESSION['cart']);