Page 1 of 1

Limiting access to a specific page

Posted: Tue Nov 13, 2007 4:07 am
by bmccon79
Hi,
I'm fairly new to PHP and was wondering what the best way (or if there even is one?) to limit the access to a specific page depending on the page that the person has come from? I've tried using the $HTTP_REFERER variable but have read that this is unreliable as it can be spoofed and that many browsers and firewalls bl;ock this information from being sent.
Any help would be appreciated greatly!

Posted: Tue Nov 13, 2007 6:29 am
by sunilbhatia79
A secure way would be to store his current visit in a single record in a database and keep updating it as and when he visits different pages... update the same record - dont insert new records for each page (unless you want to capture clickstream)...

Then on the page where you want to check his previous page, you can refer to the table where is old page that he visited is stored.

Hope this helps

Posted: Tue Nov 13, 2007 6:36 am
by sunilbhatia79
A secure way would be to store his current visit in a single record in a database and keep updating it as and when he visits different pages... update the same record - dont insert new records for each page (unless you want to capture clickstream)...

Then on the page where you want to check his previous page, you can refer to the table where is old page that he visited is stored.

Hope this helps

Posted: Tue Nov 13, 2007 10:24 am
by bmccon79
Thanks for the suggestions but unfortunately the visitors are coming from another site on a different server so I don't think I can use the methods you've suggested.
This was why I was looking at using the $_HTTP[REFERER] variable so i would supply me with an URL i could then match up to allow access.
Any other suggestions?

Posted: Tue Nov 13, 2007 10:27 am
by sunilbhatia79
Can you provide me the code to look into... i see no reason why the REFERER variable won't work.