diff --git a/gw-toon.php b/gw-toon.php
index 624598c..dbb358d 100644
--- a/gw-toon.php
+++ b/gw-toon.php
@@ -10,44 +10,47 @@ $whattoon = mysqli_real_escape_string($con, $_POST['playerid']);
if ($con->connect_errno > 0){
die ('Unable to connect to database [' . $db->connect_errno . ']');
}
-if ($whattoon == "0" or $whattoon == ""){
- $sql = "SELECT playerid, charname FROM `playername` WHERE `userid` = '$userid' ORDER BY `charname` ASC"; //need to make userid a variable
- if (!$result = $con->query($sql)){
- die ('There was an error running the query [' . $con->error . ']');
- }
- echo '
Character Selection';
- echo '
';
- echo '';
-} else {
- $sqltoon = "SELECT charname from `playername` WHERE playerid = $whattoon";
- if (!$result2 = $con->query($sqltoon)){
- die ('There was an error running the query [' . $con->error . ']');
- }
- while ($row2 = $result2->fetch_array()){
- $charactername = $row2['charname'];
- echo '' . $charactername . '';
- }
- echo '
';
-}
if (!$_SESSION['userid']){
- echo '
session is empty, put login code here
';
+ echo 'Please login first';
+ echo '';
} else {
- echo '
';
-}
+ if ($whattoon == "0" or $whattoon == ""){
+ $sql = "SELECT playerid, charname FROM `playername` WHERE `userid` = '$userid' ORDER BY `charname` ASC"; //need to make userid a variable
+ if (!$result = $con->query($sql)){
+ die ('There was an error running the query [' . $con->error . ']');
+ }
+ echo 'Character Selection';
+ echo '
';
+ echo '';
+ } else {
+ $sqltoon = "SELECT charname from `playername` WHERE playerid = $whattoon";
+ if (!$result2 = $con->query($sqltoon)){
+ die ('There was an error running the query [' . $con->error . ']');
+ }
+ while ($row2 = $result2->fetch_array()){
+ $charactername = $row2['charname'];
+ echo '' . $charactername . '';
+ }
+ echo '
';
+ }
+ echo '
';
+ }
?>
\ No newline at end of file