Mortgage - Mortgage Calculator - Outsource - Home Insurance - Mortgages

PDA

View Full Version : Restrict Access...


ECS Dave
Mar 23rd 2008, 3:52 pm
I understand referral data is not the most secure way to restrict access to a page. However, it will do for me.

How do I accomplish this:

Access to a target page is granted ONLY from a certain other page.

For example: Visitor A clicks a link to page B from page A, is allowed to access the page B.
Visitor B types in the full link to page B, is NOT allowed access to page B, and is shown whatever...

Can this be done?

I appreciate, in advance, any direction to a resource for answers, or better yet - the answer.

Be Well!
ECS Dave

zerxer
Mar 23rd 2008, 10:18 pm
if($_SERVER['HTTP_REFERER'] != "site a") die("You're NOT allowed access");

ECS Dave
Mar 23rd 2008, 10:46 pm
Thanks zerxer...

I however, in between the time I posted this, and now, found out that I needed a cgi solution - and I found that solution.

Thanks again though!

ECS Dave

blueparukia
Mar 23rd 2008, 11:27 pm
Zerxer's solution will work fine, no need for CGI at all.....

ECS Dave
Mar 24th 2008, 12:12 am
The "way" that the originating page was/is being presented to the user appeared to prevent the php code from working "at all".

Thanks again though!
ECS Dave