I have site for example http://www.mysite.com, with a simple login system. I use PHP and MYSQL. In session I have:
$_SESSION['user_id']
Is possible to check if the user currently has the page www.mysite.com/test.php open?
I can use also jQuery and Ajax, but how?
In database I have for example:
Users:
id | username | is_on_test
1 | admin | 0
2 | user | 1
If user is on test.php I would like have in database in column is_on_test value 1, if isn’t on test.php then should be 0.
call an ajax script every 20 or 30 secs or whatever frequency u like.
TEST.PHP
to display users list on ADMIN.PHP
make sure that the insertion / updation queries for insert / update timestamp in every ( 20 sec or whatever) interval