From ab6d805e72e40095db6378ce396ee411ee1731e5 Mon Sep 17 00:00:00 2001 From: mauirixxx Date: Wed, 24 May 2017 22:13:56 -1000 Subject: [PATCH] i think i got it? --- gw-login.php | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/gw-login.php b/gw-login.php index 5d25675..e6674d0 100644 --- a/gw-login.php +++ b/gw-login.php @@ -12,22 +12,18 @@ $sqllogin = "SELECT * FROM users WHERE users.username = '$username' and password if ($result = $con->query($sqllogin)){ $row_cnt = mysqli_num_rows($result); if ($row_cnt > 0){ - echo 'you should be logging in now!
'; //will move the while loop up to here if successful + while ($row = $result->fetch_array()){ + $uname = $row['username']; + $uid = $row['userid']; + $access = $row['access']; + $_SESSION['username'] = $uname; + $_SESSION['userid'] = $uid; + $_SESSION['access'] = $access; + echo 'Proceed to character selection here
'; //really should automate this + } } else { echo 'That was not a valid username or password!
'; + echo 'Please try again here'; } - while ($row = $result->fetch_array()){ - $uname = $row['username']; - $uid = $row['userid']; - $access = $row['access']; - $_SESSION['username'] = $uname; - $_SESSION['userid'] = $uid; - $_SESSION['access'] = $access; - echo 'Your username is ' . $uname . '. Your userid is ' . $uid . '. Your access level is ' . $access . '.
'; - } -} else { - echo 'Login failed - please try again here'; //saving this for later - exit; } -echo 'Proceed to character selection here
'; //really should automate this ?> \ No newline at end of file