If you're not having much luck with the first one, here's an alternate source:
Code:
<?php
//Set banned IP
$banned = '123.123.123.123';
//get user IP address
$userip = $_SERVER['REMOTE_ADDR'];
//check for banned IP address
if($userip == $banned){
echo "<BR>This IP address has been banned";
exit();
}
//continue with script...
?>