Forum Moderators: coopster

Message Too Old, No Replies

allow users who have been refered from my website only

pls, help me to modify this code

         

tito

12:09 am on Apr 16, 2004 (gmt 0)

10+ Year Member



i need to allow users, to one of my webpages, who have been refered from my website only, and this code should do the work:

<?
$from = getenv("HTTP_REFERER");
if ($from!= "http://www.domain.net/")
/* If URL is invalid the following error message and proper link appears*/
{print(" Sorry you have tried to link to a page which does not accept visitors directly. <br>
<a href=http://www.domain.net/>CLICK HERE</a> to enter");
exit;}
?>

i'd like to add another refer url further to "http://www.domain.net/", let's say "http://www.domain.net/another.php", so please how would i add this another refer url to the code above?!?

thanks in advance for your help,
tito

WhosAWhata

2:10 am on Apr 16, 2004 (gmt 0)

10+ Year Member



<?
$from = getenv("HTTP_REFERER");
if (($from!= "http://www.domain.net/") && ($from!= "http://www.domain.net/another.php")) {
print(" Sorry you have tried to link to a page which does not accept visitors directly. <br>
<a href=http://www.domain.net/>CLICK HERE</a> to enter");
exit;
}
?>

jamie

8:35 am on Apr 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hi tito,

be aware that some popular firewall products block HTTP_REFERER so you would be shutting them out of your site.

e.g. for this reason i am unable to use msn.co.uk search (not that i'd ever want to ;-)

tito

10:01 am on Apr 16, 2004 (gmt 0)

10+ Year Member



Thanks a lot WhosAWhata!

>>be aware that some popular firewall products block HTTP_REFERER
Jamie i see, please do you know of any other way to play this trick? maybe using cookies?