Thread: PHP help?
View Single Post
Old 01-28-2006, 03:10 AM  
Tempest
Too lazy to set a custom title
 
Industry Role:
Join Date: May 2004
Location: West Coast, Canada.
Posts: 10,217
Depending on how many urls I was going to do, I might do it something like this instead.

<?php
$okrefs=array();
$okrefs['http://www.url1.com/page.shtml']=1;
$okrefs['http://url1.com/page.shtml']=1;
$okrefs['http://www.url2.com/page.shtml']=1;
$okrefs['http://url2.com/page.shtml']=1;
$ref=strtolower($HTTP_SERVER_VARS['HTTP_REFERER']);
if($okrefs[$ref]= =1){
echo("OK");
}else{
echo("Redirect this");
exit();
}
?>

But some browsers/surfers will hide the referer so then you can't really do this at all. Is it for admin type purposes?
Tempest is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote