0

hey people. i am asking if it is posible to check for the user status using php. i mean to know if the user if online or offline.
i am trying to build a chatting system that alow me to know who is online and who is offline.

5
Contributors
6
Replies
10
Views
6 Years
Discussion Span
Last Post by 84hd0ns
0

i guess this is one of the things i want to know. but now i got another question which is how do i use this technology?
and i am asking how to know who is online like facebook.
you can see a list of the people who are online and chat with them. so this is what i am asking about

0

websocket.org echo example does nothing for me. Says my browser supports it (chrome10 Win), but nothing happens on connect.

0

Hi

maybe you could try...

when the user logs in:

$user = "logged-in/$username";
$user = fopen($user, 'w') or die('ERROR');
fclose($page);

on logout:

unlink($username);

to list users:

$users = sort(glob('logged-in/*'));
foreach ($users as $user) {
  print $user; 
  print '<br />';
}

good luck :)

Calum

0

In order to track users, you'll need some sort of logon process. The previous post provides a low-end approach to doing this. This may satisfy your needs, otherwise you'll want to look at using a database to keep the user information, including their login status. You need a process to force a logoff for anyone who is inactive for a set period of time. Otherwise, everyone will eventually show as logged on / active.

Edited by chrishea: n/a

0

good point chrishea; i'm not very familiar with mysql... lol, thats why my cms is flat file!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.