Forum Moderators: coopster
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