diff --git a/getauthtoken.php b/getauthtoken.php index 541186b..1f416cc 100644 --- a/getauthtoken.php +++ b/getauthtoken.php @@ -1,22 +1,21 @@ isLoggedIn()) { - header('location: /login'); + header('location: /login'); // alr hes not signed in so get him out of here exit; } $placeid = $_GET['placeid']; if (!isset($placeid)) { - echo "No placeid"; - exit; + die("No placeid"); // placeid was not found AND FUTURE MARIO HERE USE GOD DAMN DIE() } $username = $user->getUsername(); $id = $user->getID($con, $user->getUsername()); @@ -29,7 +28,7 @@ function generateRandomString($length = 25) { } return $randomString; } // pls don't hurt me -$checkifuser = $con->prepare('SELECT COUNT(*) FROM games WHERE id=:placeid'); +$checkifuser = $con->prepare('SELECT COUNT(*) FROM games WHERE id=:placeid'); // check if the game even exists $checkifuser->bindParam(':placeid', $placeid); $checkifuser->execute(); $momentoftruth = $checkifuser->fetchColumn(); @@ -49,18 +48,17 @@ if ($momentoftruth == 1) { $fbi2->execute(); $china3 = $fbi2->fetch(PDO::FETCH_BOTH); $token = $china3['token']; - die($token); + die($token); // DIE! } elseif ($getintforchecktoken == '0') { $token = generateRandomString(500); - $fbi = $con->prepare('INSERT INTO tokens (token, placeid, userid) VALUES (:token, :placeid, :userid)'); + $fbi = $con->prepare('INSERT INTO tokens (token, placeid, userid) VALUES (:token, :placeid, :userid)'); // make the token valid $fbi->bindParam(':token', $token); $fbi->bindParam(':placeid', $placeid); $fbi->bindParam(':userid', $id); $fbi->execute(); - die($token); + die($token); // HE FINALLY USED DIE } } else { - echo 'No placeId found'; - exit; + die('No PlaceId found'); // reminder to use die } ?>