Welcome Guest, Not a member yet? Register   Sign In
users status('online','offline')
#1

[eluser]Unknown[/eluser]
I tried the code below, to show users status(online or offline),but it shows only offline status to all users,even if they login into the site....can anyone help me out...so that users are showed online status,when they are online and vice versa.
<?php
include 'db_connect.php';
$username = $_POST['username'];
$query = "SELECT * FROM users WHERE username = '$username'";
$result = mysql_query($query);
if(mysql_num_rows($result)>0){
while($row = mysql_fetch_array($result)){
echo "online";

}

}
else{
echo "offline";
}
?>
#2

[eluser]Dam1an[/eluser]
a) Why not carry this on in this thread
b) This isn't even CI code!
#3

[eluser]GSV Sleeper Service[/eluser]
er, what's this got to do with codeigniter? I'm a self proclaimed 'orrible bastard, and I quite often choose "' or 1=1-- " as a username




Theme © iAndrew 2016 - Forum software by © MyBB