I'm not sure that would be the case tho, because I can do a partial ban of his IP address, ie instead of the whole numeric address, I can simply find his provider information at the end of his IP address:
well....
while you could ban the proxies as well it will go on for a long time.. (if you lucky, they don't know how to connect to a proxy server or have software to do it for them)
the code is okay.. it doesn't need to be too complex but i have delt with these types of people before and i think your need to rethink the auto-activation part.
i would probably code it like this
<?php
$banned[0] = "IP Address 1";
$banned[1] = "IP Address 2";
$banned[2] = "IP Address 3";
$banned[3] = "IP Address 4";
$Accepted[0] = "Username 1";
$Accepted[1] = "Username 2";
$Accepted[2] = "Username 3";
$Accepted[3] = "Username 4";
$ban = false;
$ban = in_array($_SERVER['USERNAME'], $Accepted);
$ban = (in_array($_SERVER['REMOTE_ADDR'], $banned))?true:$ban;
if ($ban)
{
echo "You have been banned from this website.";
echo "If you believe you have received this in error contact us.";
echo "admin@blah.net";
}
?>
edit: oops on the code (forgot to remove some lol)