Jump to content

[SOLVED] Page access / Preventing Non-linear action


karenn1

Recommended Posts

Hey everyone,

 

I have a website where you can place an order to send a package to London. My pages are setup as parcels1.php, parcels2.php. etc. There are 7 steps to follow (address, package size, payment, etc) when sending a parcel. How can I prevent someone from just typing in www.mysite.com/parcels3.php to skip steps? Because Step 1 creates the Session ID, I need the user to move linear from 1 through to 7.

 

How can I do this with PHP?

 

 

Thanks!

Karen

For instance, at the bottom of the first page:

 

page1.php

// After you've validated your values and everything is fine to continue:

 

$_SESSION['at_page'] = 2;

--

page2.php

if ($_SESSION['at_page'] == 2)

{ //do your page2 stuff

 

// after everything is validated again, and you're ready to continue

$_SESSION['at_page'] = 3;

}

else { echo "Please start at page one"; }

 

etc etc

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.