View Full Version : Removing a session

06-07-2004, 02:17 PM
Hi All...

I have chat rooms built with PHP. When a user enters a room, the count stored in my sql database goes up one, so that those who are yet to enter the room can see how many are in there...

Now, I know I can subtract one when a person has been inactive for a certain amount of time (eg. time them out for being idle after 15 minutes) - but what I would like to do is subtract one immediately when the person closes the browser.

Now I know this is a JavaScript related question, however the action of the JS needs to cause a php function, so I am thinking this is best suited in the PHP Forum and answerable by those in the know of both! LOL. Hope I'm right.

Thanks in advance for any point in the right direction! :thumbsup: