simplify php code
Posted: Sun Sep 30, 2007 6:32 am
hello,
i have some code on my site to check referer and then if it is my site then the php page will work, otherwise it will display an error.
now at the moment im doing that by:
but what about when i want ot add other domains? yeh i could make lots more if statements, but is there another simplere way to do it?
thanks!
i have some code on my site to check referer and then if it is my site then the php page will work, otherwise it will display an error.
now at the moment im doing that by:
Code: Select all
$valref=substr($ref, 0, 23);
if($valref == "http://www.xxxxxx."){
$valref=substr($ref, 0, 27);
if($valref == "http://www.xxxxxx.com/"){
$ok = "yes";
}
}else{
$valref=substr($ref, 0, 23);
if($valref == "http://xxxxxx.com/"){
$ok = "yes";
}
}thanks!