Forum Moderators: coopster

Message Too Old, No Replies

Who's online PHP script?

Anyone know or use a good who's online script?

         

JAB Creations

7:44 pm on Jun 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I know it might bug some people but I enjoy knowing who is on my site and where people's interest on my site lies. Anyone have a suggestion for a stand alone Who's Online script written in PHP?

mcibor

9:39 pm on Jun 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Check www.hotscripts.com for that.

There are two safe ways to do such script:
1. Use a file with login/logout count //not recommended
2. Use a db with table users (it must contain fileds login_date and logged)

The second way:
On user login, or on user connect to server (as you wish) update the login_date and logged. On every page open also update login_date.

If the hour passed from login_date, then change the logged to 0
On logout change logged to 0

To check how many and or who is logged
SELECT user FROM users WHERE logged='1';
$how_many_logged = mysql_num_rows($query);
best regards
Michal Cibor