Hi all,
I have a web page coded using PHP/HTML/Javascript which I want to close if no user activity is involved for half an hour. How do I do this?
Any early help will be very much appreciated. Thanks in advance.
Not in PHP, because PHP's involvement in the process finishes when the page has been output to the client. It can't do anything to the page after that (including closing windows); you have to use Javascript to do anything more.
You'll have to use Javascript. "User activity" is a vague term. You could hook the mouse movement and keypress events as well as focus changes on any elements of the page. Each of these could then reset a timer which will close the window.
Mark
That part is easy, however you cannot close a browser window with scripting, that you didn't OPEN with scripting. So if this isn't a window your site opened, you can't close it