|
Posted by burgermeister01@gmail.com on 08/22/07 21:20
On Aug 22, 2:45 pm, jodleren <sonn...@hot.ee> wrote:
> Hi!
>
> I have this on the page:
> <?php
> header("Pragma: no-cache");
> header("Expires: -1");
> ?>
>
> but I want it so, that when the user goes back, (s)he might not be
> allowed too - say the session has expired.
>
> How can i achive that?
>
> BR
> Sonnich
Generally what you're describing is something you want to avoid
whenever possible. Breaking the back button is generally bad for
usability and confusing for the user. However, if you feel that it is
entirely necessary to do, probably the best thing you can do, is set a
session variable when the user goes to the first page, and then modify
it on the second page in some way to indicate they've been to that
second page. Have a check on the first page, that looks for the
session variable and does some checks on it to ensure that the user
hasn't visited the second page. Maybe something like this:
//page1.php
if(isset($_SESSION['page_token']) && $_SESSION['page_token']) ==
"beentosecondpage"){
//stop script execution, or present user with alternative content
}
Navigation:
[Reply to this message]
|