How to detect if a user leaves a page in PHP

前端 未结 5 1566
Happy的楠姐
Happy的楠姐 2020-12-20 20:02

There is this function which i want to execute in case the user leaves a particular page. This function will basically change all of the data within a certain column in my d

5条回答
  •  执念已碎
    2020-12-20 20:29

    You can't do this in php but you could use the javascript function onbeforeunload, here an example

    
    

提交回复
热议问题