Jump to content


Photo
- - - - -

Banning An Ip


  • Please log in to reply
No replies to this topic

#1 Kev

Kev

    Young Padawan

  • Members
  • Pip
  • 21 posts

Posted 03 May 2005 - 06:48 AM

It's quite easy actually... heres the code :

<?php
//This retrieves the ip of the user
$ip=getenv('REMOTE_ADDR');
//Insert the user's IP here
$banned=xx.xx.xxx;
if (ereg($banned,$ip)) {
echo 'Banned';
exit();

}
?>

There you go :D simple IP banning. Of course you can also change what it echo's in this case when the user with that IP comes to the site it will say Banned. You could fool them by saying like site is down but I prefer huge red letters ;)


this tutorial was made by someone on my staff.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users