php - Insert into Mysql table when user closes browser? ← (PHP, JavaScript, JQuery, MySQL)

one text

Solution:

javascript based but you can send an ajax request using the window.onclose event handler

jquery has the $(window).unload(....) which should handle the different implementations across browsers (some don't support the onclose event handler).

Source