Controlling Navigation With PHP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Xeon

    Controlling Navigation With PHP

    Hi,

    I got a set of pages which must be navigated in a strict manner. Let's
    just say the pages are named A, B, C, and so on. I got no problem with
    forward navigation, but I want to disable the client browser's back
    button. More specifically, if the user is currently at page D, the
    back button doesn't bring the user to page C, but page A instead
    (assuming consecutive navigation, from A to B to C and so on).

    How can I achieve this with PHP, assuming both the server and the
    client are behind strict firewall (both referer and cookies disabled),
    and use of client-side javascript are avoided as much as possible (or
    even considered disabled as well, either by the firewall or the
    browser's setting)?

    TIA
  • Pedro Graca

    #2
    Re: Controlling Navigation With PHP

    Xeon wrote:[color=blue]
    > I got a set of pages which must be navigated in a strict manner. Let's
    > just say the pages are named A, B, C, and so on. I got no problem with
    > forward navigation, but I want to disable the client browser's back
    > button. More specifically, if the user is currently at page D, the
    > back button doesn't bring the user to page C, but page A instead
    > (assuming consecutive navigation, from A to B to C and so on).
    >
    > How can I achieve this with PHP, assuming both the server and the
    > client are behind strict firewall (both referer and cookies disabled),
    > and use of client-side javascript are avoided as much as possible (or
    > even considered disabled as well, either by the firewall or the
    > browser's setting)?[/color]


    Not tested
    =============== =============== =========

    page A:
    <?php
    // disable caching!
    session_start() ;
    $_SESSION['last_page'] = 'A';
    // rest of page A
    ?>


    page B:
    <?php
    // disable caching!
    session_start() ;
    if (!isset($_SESSI ON['last_page']) || $_SESSION['last_page'] != 'A') {
    header('Locatio n: pageA');
    }
    $_SESSION['last_page'] = 'B';
    // rest of page B
    ?>


    page C:
    <?php
    // disable caching!
    session_start() ;
    if (!isset($_SESSI ON['last_page']) || $_SESSION['last_page'] != 'B') {
    header('Locatio n: pageA');
    }
    unset($_SESSION['last_page']);
    // rest of page C
    ?>


    page D (and all other pages):
    <?php
    session_start() ;
    unset($_SESSION['last_page']);
    // rest of page D
    ?>


    --
    USENET would be a better place if everybody read: | to email me: use |
    http://www.catb.org/~esr/faqs/smart-questions.html | my name in "To:" |
    http://www.netmeister.org/news/learn2quote2.html | header, textonly |
    http://www.expita.com/nomime.html | no attachments. |

    Comment

    • Tony Marston

      #3
      Re: Controlling Navigation With PHP


      "Xeon" <xdblade@zworg. com> wrote in message
      news:78321f06.0 407031232.586d4 7a7@posting.goo gle.com...[color=blue]
      > Hi,
      >
      > I got a set of pages which must be navigated in a strict manner. Let's
      > just say the pages are named A, B, C, and so on. I got no problem with
      > forward navigation, but I want to disable the client browser's back
      > button.[/color]

      It is simply not possible to disable the BACK button the browser. Take a
      look at http://www.tonymarston.co.uk/php-mys...ttonblues.html for a
      workaround.

      --
      Tony Marston

      This is Tony Marston's web site, containing personal information plus pages devoted to the Uniface 4GL development language, XML and XSL, PHP and MySQL, and a bit of COBOL



      [color=blue]
      > More specifically, if the user is currently at page D, the
      > back button doesn't bring the user to page C, but page A instead
      > (assuming consecutive navigation, from A to B to C and so on).
      >
      > How can I achieve this with PHP, assuming both the server and the
      > client are behind strict firewall (both referer and cookies disabled),
      > and use of client-side javascript are avoided as much as possible (or
      > even considered disabled as well, either by the firewall or the
      > browser's setting)?
      >
      > TIA[/color]


      Comment

      Working...