On Tuesday 02 April 2002 16:59, Erik Price wrote:
> On Thursday, March 28, 2002, at 06:50  PM, Michael Virnstein wrote:
> > This is not possible. You cannot force the browser
> > not to go back in its history, don't even trie to find a solution for
> > this...
> > the question you should ask yourself is not how to disable the browser
> > history
> > but how you can prevent your page by getting screwed by multiple posts.
>
> I see.  Then, when I try to do something similar to this on FedEx.com or
> Amazon.com, is it JavaScript that redirects me to an error page?  If so
> then I will have to use both tactics -- preventing a form from being
> resubmit, and JavaScript to "disable" the back button (unethical as it
> may be).

i dont know if this really would solve your problem, but what i am using 
sometimes is:
    if( $save_data )
    {
        $id = save( $_REQUEST['data'] );
        if( $id != false ) // is it a valid id?
        {
            header('Location:'.$_SERVER['PHP_SELF'].'?id='.$id );
            die();
        }
    }
explaination: what it does is saving the $_REQUEST['data'] and on success, it 
reloads the same page again but without the posted data to show exactly the 
data that had been saved i use the $id returned by the 'save'-method, which 
is the id of the data set that was saved

so reload or back buttons wont disturb
on reload, simply the same page with the GET-param is reloaded
and back button goes to the page before, since it seems the 
"header"-redirection is not saved in the history

this only works for special cases:
- if you load the same page again, and want to show the entered data, it has 
to be the same page for showing and editing the data
- showing data also has to work using $_GET-parameters, as this is what the 
"header" function does

drawbacks are:
- only useful in some special cases
- browser gets contacted once more, than actually necessary ('header')


-- 
Wolfram

... translating template engine ....
  http://sf.net/projects/simpletpl

... authentication system ....
  http://sf.net/projects/auth

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to