Reply to Re: disable backbutton - when page has expired...

Your name:

Reply:


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
}

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация