php - Print all logged-in users in SESSION? -


i have session supports 80 users, want print usernames , refresh page every 60 seconds or so. know how refresh page <?php print_r($_session['username']); ?> printing username associated personal session.

unfortunately sessions variables don't work that.

for track each session, 1 method log each login/connection mysql table time stamp attached it.

then on tracking page, have delete inactive users, select rest:

ie

mysql_query("delete sessions time < " . time() - 60);  $result = mysql_query("select * sessions");  while ($row = mysql_fetch_assoc($result)) {      echo $row['username'] . "<br />"; } 

then toss in <meta http-equiv="refresh" content="60"> refresh page ever minute.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -