For example: Now there are 1,2,3. 3 pages. You want the user to start with the first page, then click Next to see the second page, and then before you go to Page Three, the user cannot
Back off. Let 1 and 2 be the same page. Leave a mark in the session so that:
1and2.php
Copy Code code as follows:
<?php
Session_Start ();
if (Isset ($_get[' P2 ')) {
$_session[' enteredPage2 '] = true;
}
if (Isset ($_session[' EnteredPage2 ')) {
Output page 2. In page 2, the links to Page 3 include the following
Echo is page 2. <a href=\ "3.php\" >Page3</a> this time not back to P1 ~ ";
} else {
Output page 1, contains links to page 2 as follows
Echo is page 1. <a href=\ "p2=\" ">Page2</a>";
}
?>
The following is 3.php, which means that the user has already visited the P2, to allow users to access the P1
Copy Code code as follows:
<?php
Session_Start ();
unset ($_session[' enteredPage2 '));
?>
In the example above, page 1 and page 2 are all temporary pages generated by 1and2.php. When the user's browser to read this address, you output page 2 is page 2, do not worry about users
will go back to page 1. This is the most fundamental solution that is not browser-independent.