I'm trying to block auto-refreshing on a webpage. Either by a browser plugin (FF), The Opera browser's 'auto-reload' feature or by clicking the refresh button. Does anyone know of a way i can do this?
Not with PHP, Since it runs on the server, it has no control over browser functions.
You would need Javascript or some other Client Side script to disable it.
Although many people may find the inability to refresh annoying. Maybe you should rethink your script, and whgy you need to block the refresh button.
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
You can have your script check for something such as a session variable, you set
If the variable is set, that means the script has already been run, and more than likely the browser has been refreshed. If that is the case, then you do not proceed with the rest of the script, and either redirect somewhere, or issue a message.
If however the session variable is not present, that means the script is being run for the first time, hence you proceed with it.
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.