Q:

Prevent a user from pressing back, reload or close button

How to implement a function that prevents the user from using back, reload and close button of the browser? I mean that even if the user presses the reload, back or close button, those buttons do not work. 
I saw similar question on stackoverflow but didn't find any relevant answer.
I want to achieve this because my laptop has some problem and these buttons work automatically sometimes which interrupt my work.

A:

You cannot, you have no authority to do so at the client computer.

A:

Use a javascript redirect page - though these are annoying to the user.
Say you have a form, use PHP header() to redirect to a page that contains a javascript meta-refresh looks like (<meta http-equiv="refresh" content="0;URL='http://example.com/'">) which forces the user to a new page. When they hit back, they will hit that page and be forced forward again.
Edit: You cannot do anything about a close - but if you use this to redirect to a page that doesn't process anything like form information, then the user hitting refresh will not matter. They are on a static page anyhow.
Edit 2: I think it is amusing that when we use a PHP header() to redirect the user away from processing a payment transaction twice by accident, it is considered a good thing - but when a question like this comes up, everyone assumes the worst that someone is hijacking a webpage with horrible ads or spamming up some bollocks or other (and therefore the downvotes).

