Is it possible to ban local IPs?!
Posted: Wed Aug 18, 2004 4:35 pm
<?php
$banned_ip = array();
$banned_ip[] = '65.65.82.217';
foreach($banned_ip as $banned) {
$ip = $_SERVER['REMOTE_ADDR'];
if($ip == $banned){
echo "You are banned. Now how do you like dem apples.";
exit();
}
}
?>
I put that at the top of the page after the HTML tag. It works just fine. But for various reasons, I'd like to ban somone in my household from going to my site without banning my computer also. So is there a way to do this? I tried just putting in the local IP for his computer but it didnt work. Help!!
$banned_ip = array();
$banned_ip[] = '65.65.82.217';
foreach($banned_ip as $banned) {
$ip = $_SERVER['REMOTE_ADDR'];
if($ip == $banned){
echo "You are banned. Now how do you like dem apples.";
exit();
}
}
?>
I put that at the top of the page after the HTML tag. It works just fine. But for various reasons, I'd like to ban somone in my household from going to my site without banning my computer also. So is there a way to do this? I tried just putting in the local IP for his computer but it didnt work. Help!!