RE: handling a user pressing browser's back button

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> I changed everything to GET and it's behaving better!  Thanks.
> 
> I guess when the user clicks the back button they should just get 
> back the last state of the browser...no if, and or but's.

This is because when you click the back button on the browser it pulls
up the URL from it's history list and attempts to render the page.
Note: that the browser only saves the URL in it's history list.  When it
attempts to render pages that were entered via a GET reference, all the
data is available, and when it attempts to render a page that was
entered via a POST, it is complaining that it no longer has the "post"
data to complete rendering of the page (it only saved the URL).  Does
that make sense?

Warren Vail

Solution in PHP for forms that use POST, is to have the PHP routine
perform whatever updating is necessary, or what ever, then redirect the
browser (header function) to a page that will fetch the data from your
database and present the page.  The browser thinks that it has uncovered
a new URL for the one it found in the link and replaces the URL in the
history list which should be a GET type URL.  One advantage of this
structure is the update will only be posted once in response to a POST
and the back button will skip over the update logic (no multiple updates
from stepping backward).

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux