Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

block auto-refresh

Status
Not open for further replies.

jasek78

Programmer
Nov 5, 2001
298
US
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?

thanks

Jason
 
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.
 
Is there a chunk of header info or something that i can read and determine if the page was refreshed via the browser?

a header variable that i can access via php?
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top