Steven Hammons
Steven Hammons

Reputation: 1810

Insert into Mysql table when user closes browser?

I would like to insert a record into a Mysql table using php when the browser is closed, is this possible?

Upvotes: 0

Views: 582

Answers (1)

Ian Wood
Ian Wood

Reputation: 6573

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).

Upvotes: 2

Related Questions