@felgallFeb 21.2008 — #PHP has no way to tell whether the page is still being displayed in the browser or not. The two alternatives are either to assume that everyone has left within a specified time and process after that time or set up a heartbeat Ajax script so that the page reports back at time intervals while it is still displayed so that you know the page is no longer being displayed when the exected signal does not arrive. Web pages have no way of distinguishing whether the browser is closed or not, all they know is that you are leaving the page.