By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,216 Members | 1,023 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,216 IT Pros & Developers. It's quick & easy.

Controlling Navigation With PHP

P: n/a
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
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Xeon wrote:
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)?

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($_SESSION['last_page']) || $_SESSION['last_page'] != 'A') {
header('Location: pageA');
}
$_SESSION['last_page'] = 'B';
// rest of page B
?>
page C:
<?php
// disable caching!
session_start();
if (!isset($_SESSION['last_page']) || $_SESSION['last_page'] != 'B') {
header('Location: 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. |
Jul 17 '05 #2

P: n/a

"Xeon" <xd*****@zworg.com> wrote in message
news:78**************************@posting.google.c om...
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.
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

http://www.tonymarston.net
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

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.