Jump to content

Users online


Kingy

Recommended Posts

If your not to familiar with php, or php and mysql together my suggestion would google "PHP Useronline" you'll find a couple free scripts that you can either impliment or build off of, or learn from. Not to sound like I'm brushing you off.. but from ways ive seen it done in the past. It's not a simple task as it sounds.

Link to comment
https://forums.phpfreaks.com/topic/89126-users-online/#findComment-456452
Share on other sites

try doing something like this,

you should run this query on

all your pages that your

online users visit

 

mysql_query("UPDATE users SET last_active=NOW() WHERE id='". $_SESSION['id'] ."'");

 

be sure to edit the information to edit your information and to

create a column names last_active

 

then,

$query = mysql_query("SELECT * FROM users WHERE last_active > (NOW() - INTERVAL 5 MINUTE)");

 

that will get all your online users that have been online in the last 5 minutes,

if you want to get the information of each one, just use mysql_fetch_array()

Link to comment
https://forums.phpfreaks.com/topic/89126-users-online/#findComment-456589
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.