From f13d2ed907adc03bdb35755fb30f19644da1bf16 Mon Sep 17 00:00:00 2001 From: FractalParadigm Date: Sat, 15 Mar 2025 07:45:07 -0400 Subject: [PATCH] Tidied up user-detection code --- user/user.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/user/user.php b/user/user.php index 9c9c0a2..55d43c1 100644 --- a/user/user.php +++ b/user/user.php @@ -18,13 +18,12 @@ try { // Try opening the SQL database connection // Get results from the USERS table $results = $sqlGetUserList->fetch(); + $userExists = false; // Check if user exists if (isset($results)) { - if (mb_strtolower($_GET["username"]) != mb_strtolower($results["username"])) { - $userExists = false; - } else { + if (mb_strtolower($_GET["username"]) == mb_strtolower($results["username"])) { $userExists = true; - } + } }