How can I execute some php code after the user closes the current window/tab?

I am trying to execute some php code if a user closes a window. How can I do this? Thanks!

One Response to “How can I execute some php code after the user closes the current window/tab?”

  • Atif Majid:

    For this
    1) Try to capture the event when user closes the Tab/Window
    2) When the event is triggered, use Ajax to send request to server to execute the required PHP file.

    You can google to find the respective Event when browser is closed.

Leave a Reply