Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
php help.
#1
I want to make a group of pages. Now for the purpose of this lets call them.
page1.php
page2.php
page3.php
page4.php.

Now i simply want to force the user to start at page one and not be allowed to go to 2,3 or 4 without previously visiting the page prior.
Now i assume its simply session related but well.... PHP and me just seem to not get along.

So could anyone help?
The Rules!
FTW Forum <-- Home of the Damned! --> Join me On MM


Reply
#2
How secure does this have to be? An easy way would be to check the $_SERVER['HTTP_REFERER'] to make sure they came from the previous step, however this can be spoofed so if your dealing with payment or something then your probably better off setting a database tracked cookie at each step, with some form of encrypted cookie value which needs to be compared with what is already stored in the DB.
MyBB Support team member.
[Image: smallsig.png]
Reply
#3
at page one, you could do something like

PHP Code:
$_SESSION['lastpage'] = "one"

Before redirecting them to page two, and then at page two you could do:
PHP Code:
if ($_SESSION['lastpage'] != "one")
{
    die(
"Please complete page one first");


and just modify that appropriately for each page.
Reply
#4
Orgy's response should work, if not PM me.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  PHP Framework List: An Ultimate Guide to 102 PHP Frameworks for Web Developers tk-hassan 0 795 07-27-2020, 11:26 PM
Last Post: tk-hassan
  PHP Video Tutorials (PHP For Beginners) Eleqtriq 4 3,320 10-10-2011, 01:00 PM
Last Post: Greyersting

Forum Jump:


Users browsing this thread: 1 Guest(s)