PDA

View Full Version : Page linking?


revjection
05-11-2010, 06:16 AM
Is there a simple line of code I can use so that I can have a page only viewed when someone has been to the previous page? So for example they have to go to my home page before being able to access any other page on the site and cannot bypass it in the url. I am sure there is but I am having a hard time explaining that one to Google. I cringe at the thought of how obvious its going to be when I get my answer :roll:

edbr
05-11-2010, 06:24 AM
without a login ? well i have never tried this but i found this you could try

In a public page:
define('access',true);
In included files, use:
if (!defined('access')) {
exit;
}

revjection
05-11-2010, 05:34 PM
Sorry I was tired yesterday. It is with a login

revjection
05-11-2010, 07:04 PM
I am sure its something to do with $_SERVER ['REQUEST_URI]but I really don't have enough knowledge to understand exactly how to use it

davidj
05-13-2010, 07:34 PM
cant you just write a login system and set a session when the user logs in.

You could set the session on the home page without logging in and then just test to see if the session is set on the other pages.