nayen
1
Hi,
I have a page on my website and I want it to be accessible only by people who visit it from a certain referring site.
Let’s say my page is this:
http://www.mysite.com/my-page.php
And the referring site is this:
http://www.allowedsite.com/
I want my page to be accessible only by visitors coming from the allowed site. Is there a way to do this with PHP?
Thanks.
The first thing I would do is put a dummy page up with the following
<?php var_dump($_SERVER); ?>
Then navigate to that page from allowedsite.com
You will see the variables that were developed with this request on the page (better formatted if you do a view source)
I believe there is a HTTP_REFERER_URL variable inside $_SERVER, but it has been my past experience that the field isn’t always populated.