Jump to content

user online


MDanz

Recommended Posts

You'd need to either make a database of users that are online for reference or have a column in your users table that saves the last time a user was on your website. In your code that shows whether another user is online or not, you'd need to specify which user your talking about.

 

$username = "eugeniu";
$username = // code to retrieve entry for "eugeniu" goes here

if (time(); - $username['laston'] < 5*60) // 5 minutes till last on
{
echo "User is online.";
} else {
echo "User is not online.";
}

Hope that helped...

Link to comment
https://forums.phpfreaks.com/topic/175874-user-online/#findComment-926697
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.