Online buttom shows online

Status
Not open for further replies.

KimStar

Habbo Guardian
Feb 18, 2012
276
57
This online buttom is online even when the users is offline
 

Attachments

  • pic1.png
    pic1.png
    43.6 KB · Views: 32
Last edited:

sumo

The end is nigh.
Jan 18, 2014
143
102
While technically I couldn't find any error causing code, try these fixes:

At the beginning of your while loop, try changing:
PHP:
$onlineStatus = "online";
if($belcr_row['online'] == '0')
$onlineStatus = "offline";
To:
PHP:
if ($belcr_row['online'] == 0) {
    $onlineStatus = "offline";
} else {
    $onlineStatus = "online";
}
While the syntax you have is technically acceptable, it's not the best thing to be using.

You could also take the fight to the echo statement itself. So first, completely remove the code at the beginning of the while statement pertaining to the online status, then change:
PHP:
<?php echo $onlineStatus; ?>
to
PHP:
<?php if ($belcr_row['online'] == 0) { echo "offline"; } else { echo  "online"; } ?>
 
Status
Not open for further replies.

Users who are viewing this thread

Top