From 9ac2f5c5639807420efc15faa9e1d3d1fe74efb0 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Wed, 22 May 2024 16:06:17 +0200 Subject: [PATCH] added user existence check to forum --- forum.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/forum.php b/forum.php index ee817ef..03aabf4 100644 --- a/forum.php +++ b/forum.php @@ -1,12 +1,21 @@ query("SELECT username FROM user WHERE BINARY username=\"" . $_SESSION["username"] . "\""); + +if ($out -> num_rows != 1) { - header("Location: ./index.php"); - return; + fail: + echo "nope"; + header("Location: ./index.php"); + return; } ?> +