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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

blocking refresh

Status
Not open for further replies.

jasek78

Programmer
Nov 5, 2001
298
0
0
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
 
Does anyone know of a way i can do this?

I think I can speak for everybody by saying no.

Sorry, it's not possible.

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson
 
well, are you the creator of the page? do you have auto-refresh set somewhere in the meta tags or with javascript? if yes to both of those questions, yes it's possible. otherwise, see kaht's response above.



*cLFlaVA
----------------------------
[tt]"quote goes here"[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
1. It IS possible... I've seen it done.

2. auto-refresh is NOT set, in META or anywhere else.

Read the question again. I have a webpage that i don't want the user to be able to refresh using their browser. I want them to have to use the website navigation to browse the pages, instead.

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

1. It IS possible... I've seen it done.

Really? I'd love to see some code that prevents a person from refreshing the page by hitting the refresh button. Or by pressing f5 in the browser window. Or by bringing up the context menu and clicking reload. Please, a code example if you will.

On the other hand if you are unable to find code to do as you stated (and I can tell you now that you will not find it because it doesn't exist), please do everyone a favor by posting back to confirm that it's not possible. That way we don't have to bother with a bunch of bozos referencing this thread saying "Yes, I know it's possible because I saw someone post that it is possible"


This falls into the realm of hiding your source code. You just can't do it and you're wasting your time if you try.

Why not recode your page to work around the refresh button instead of taking away a user's inherent navigation capabilities?

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson
 
Please... I apologize for my sarcasm earlier... however a simple 'I think I can speak for everybody by saying no. Sorry, it's not possible. ' isn't really a response.

What I'm looking for, as i restated, is a way to determine if the page was refreshed. Is there a header flag that is passed? If i can determine that the page is refreshed, i want it to cancel the post operation and display a short message.
 
Use cookies. Check for a cookie when the page is loaded, and if there isn't one, set one to expire after a short time period. On the page submitted to, delete the cookie.

Lee
 
What I'm looking for, as i restated, is a way to determine if the page was refreshed.

I don't see anywhere that you "restated" that you wanted to determine if the page was refreshed. All you said is that you wanted to prevent them from refreshing the page - the answer to this, as stated above, is no - it cannot be done. However, if you're just trying to determine if the page has been refreshed then you can absolutely do that. Lee offered a great suggestion above, and it's not too difficult to implement. Additionally, if this is an issue of data being incorrectly manipulated in the database as a result of multiple submissions, it should be checked at that level as well (just in case the users have cookies disabled)

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top