stop refresh?

  • jannin
  • Beginner
  • Beginner
  • User avatar
  • Joined: Nov 30, 2003
  • Posts: 40
  • Loc: Cranbrook, BC Canada
  • Status: Offline

Post April 8th, 2004, 10:50 pm

Hey all,
Just wondering if there's any way to stop someone from refreshing a page?
Php would be preferable but I can probably manage something else...
The reason I'm asking is because I have a form sending information to a database. I don't want the user to be able to refresh the page and accidentally/on purpose send the information twice. I figured I could just put a time limit on it; they can only go back to the page every day, or something, which will work fine for my cause, but now I'm just curious as to whether it's possible.
Thanks all!
/jannin
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post April 8th, 2004, 10:50 pm

  • Scorpius
  • Proficient
  • Proficient
  • User avatar
  • Joined: Mar 20, 2004
  • Posts: 401
  • Loc: Scorpion Hole
  • Status: Offline

Post April 9th, 2004, 3:36 am

Well, I don't know if that is really possible, most of the sites that I've seen with something like you want just put a nice message that says please do not refresh this page until you are redirected.
  • Managedlinks
  • Proficient
  • Proficient
  • No Avatar
  • Joined: Mar 31, 2004
  • Posts: 294
  • Status: Offline

Post April 12th, 2004, 11:02 pm

You cant stop people refreshing a page. but you can stop them from clicking a button twice using javascript. you can also add a hidden field to a page that contains a unique identifier

When your processing script receives the page the first thing it does is check the identifier to see if it has been used before. if it has the refresh is ignored and a message returned. or anything else you may want.
  • jannin
  • Beginner
  • Beginner
  • User avatar
  • Joined: Nov 30, 2003
  • Posts: 40
  • Loc: Cranbrook, BC Canada
  • Status: Offline

Post April 13th, 2004, 3:47 pm

Now why didn't I think of that?
Thanks a bunch, Managedlinks, works like a charm!
  • Managedlinks
  • Proficient
  • Proficient
  • No Avatar
  • Joined: Mar 31, 2004
  • Posts: 294
  • Status: Offline

Post April 13th, 2004, 5:11 pm

:)

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: Bigwebmaster and 176 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.