[ad_1]
There is no way to do that. Except you may show an alert to user, when he tries to close window.
About the alert:
Warn user before leaving web page with unsaved changes
[ad_2]
solved How to disable back and refresh button in browser using php