System Idle state checking in PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
shanu_040
Forum Newbie
Posts: 3
Joined: Thu Aug 09, 2007 7:18 am

System Idle state checking in PHP

Post by shanu_040 »

Hi to all,

This is my first post in this forum. I want to know how can i know that a client is in idle state(I mean keyboard and mouse is not working).

Amit
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Post by VladSun »

I think you can check it only if the window (IE, FF) with your page is focused. You can then use AJAX + onmousemove + onkyeup.
There are 10 types of people in this world, those who understand binary and those who don't
shanu_040
Forum Newbie
Posts: 3
Joined: Thu Aug 09, 2007 7:18 am

Post by shanu_040 »

I am developing a system which should be able to detect that a system is in idle state (he is not using mouse and keyboard) . and after 10 mins of idle state..it should logout the person and update the database. I am using PHP 5.2.3.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Yes, VladSun's suggestion would be exactly what you are after. But.... Why log them out?
shanu_040
Forum Newbie
Posts: 3
Joined: Thu Aug 09, 2007 7:18 am

Post by shanu_040 »

what do you mean by window(IE, FF) is focused. Can you kindly give detailed sollution so that i can move futher
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Post by VladSun »

To be the active window - the one wihich gets the user input.
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply