Forum Moderators: coopster
$host = strtolower($_SERVER['REMOTE_HOST']);
$ip = $_SERVER['REMOTE_ADDR'];if (strpos($host,'angeles') ¦¦ strpos($host,'beverly') && $ip!='123.456.78.9'){
header('Location:http://www.example.com/losangeles.html');
}
(The $ip portion to allow a moderator to edit content that happens to be from that part of the world)
I also want to ban people from the 12.345. IP range from that section too. I tried this:
if (strpos($host,'angeles') ¦¦ strpos($host,'beverly') ¦¦ strpos($ip,'12.345') && $ip!='123.456.78.9'){
header('Location:http://www.example.com/losangeles.html');
}
[edited by: jake66 at 10:00 am (utc) on Jan. 16, 2008]
[edited by: dreamcatcher at 9:31 am (utc) on Jan. 17, 2008]
[edit reason] Use example.com, thanks. [/edit]
Try this:
if ((strpos($host,'angeles') ¦¦ (strpos($host,'beverly') ¦¦ (strpos($ip,'123.456.') && ($ip!='12.345.78.9')){
header('Location:http://www.example.com/losangeles.html');
}
[edited by: dreamcatcher at 9:31 am (utc) on Jan. 17, 2008]
[edit reason] Use example.com, thanks. [/edit]
Also tried this:
if (strpos($ip,'11.22.33')){
header(' Location: http://www.example.com');
}
Any reason that isn't even checking the IP, which seems to be why the redirect isn't working.
Have you heard about (geoIP) free database?
[edited by: dreamcatcher at 9:31 am (utc) on Jan. 17, 2008]
[edit reason] Use example.com, thanks. [/edit]