Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Why does my script run again, when I refresh my results page?

by pemungkah (Priest)
on Apr 09, 2003 at 19:59 UTC ( [id://249396]=note: print w/replies, xml ) Need Help??


in reply to Why does my script run again, when I refresh my results page?

You can force a browser to think you're accessing a new URL (and thereby force it into the history) by adding a dummy "uniquifier" to the URL. As long as the URL "looks different" to the browser (i.e., it's not character-for-character identical), the browser will treat it as a "different page". Pages with uniquifiers get added to the history, and can be back-buttoned to.

Your server can completely ignore the uniquifier, as long as it sends a new one every time.Try something like this: http://myserver.com/cgi-bin/myscript.cgi?u=438292& ..., and just keep changing the number. For forms, use a URL like this as the form's action: http://myserver.com/cgi-bin/myscript.cgi/u432443, which will do the same thing.

You have the disadvantage that the user can back-button to a page and then proceed "forward" again from there, generating the kind of problem you were speaking of, but you can (if you've got some kind of a session mechanism set up) remember the uniqifier from a "problem" page and skip doing the thing you don't want if the uniqifier is the one you remembered.

  • Comment on Re: Why does my script run again, when I refresh my results page?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://249396]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-16 13:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found