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