RE: [PHP] preventing "back" button usage?
| From: | Darren Gamble | Date: | Wed, 27 Mar 2002 21:11:07 +0000 |
| Subject: | RE: [PHP] preventing "back" button usage? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-90427@lists.php.net to get a copy of this message | ||
Good day,
This can be accomplished in a few ways. The easiest way is to tell the
client not to cache the page. And yep, you do this via headers.
In PHP (attempting to hit as many types of browsers as possible):
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Pragma: no-cache");
You can also do some fancy redirection with Location headers.
As a failsafe, you should have the processing page make sure that the user
isn't submitting the same thing more than once.
============================
Darren Gamble
Planner, Regional Services
Shaw Cablesystems GP
630 - 3rd Avenue SW
Calgary, Alberta, Canada
T2P 4L4
(403) 781-4948
-----Original Message-----
From: Erik Price [mailto:pricee@hhbrown.com]
Sent: Wednesday, March 27, 2002 2:10 PM
To: php-general@lists.php.net
Subject: [PHP] preventing "back" button usage?
Sorry to plague this list with questions today, but I was hoping someone
could help me understand a fundamental thing about how browsers work --
how can I achieve the effect that many ecommerce sites (such as Amazon)
use to prevent the user from going "back" in their history? For obvious
reasons, I would like to avoid JavaScript to achieve this feat. I have
some multi-part forms that I do not wish users to be able to repeat
accidentally.
I believe it has something to do with a header and the browser's cache,
but I really don't know anything about it.
TIA,
Erik
----
Erik Price
Web Developer Temp
Media Lab, H.H. Brown
pricee@hhbrown.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php