Hello.
I was asked to write a "IP Ban" feature into one of my scripts. I personally hate IP Ban features, but that is a whole other story.
Here is what I have, so far:
< ?
$IPBan = array("123.45.67.89", "555.55.55.55");
$verify = getenv("REMOTE_ADDR");
for ($i=0;$i<count($IPBan);$i++) {
if (eregi("$IPBan[$i]", $verify)) {
if ($verify !="$IPBan[$i]") {
echo "Access HTML CODE Goes Here";
} else {
print "Sorry you don't have acces to this page";
}
}
}
? >
When I place my IP address within the array, I get the "Sorry you don't have access to this page" message. But, when I take my IP address out, I just get a blank screen. <sigh>
Any ideas?
Or does anybody have another/better method of doing this??
(first time I've tried writing an IP ban script)
Thanks guys.
JbA