Ban Ip

Skilled Illusionist
Joined
Feb 14, 2008
Messages
303
Reaction score
41
if anyone can help please?
I need to do a page where you can ban ip

I have this code

Code:
<? 
//Message that the banned one will get: 
$msg_ban = "This ip is banned ur not restricted to this page ~ Rodi for more contact us at [email protected]"; 

//Put here the ip's that u wanna ban 
$ipadr[0] = ""; 
$ipadr[1] = ""; 
$ipadr[2] = ""; 
$ipadr[3] = "";
$ipadr[4] = "";
$ipadr[5] = "";
$ipadr[6] = "";
$ipadr[7] = "";
//U can put more ipban's if u put those line's with evertime a diferent number: 
//$ipadr[3] = "ipadreshier"; 

$aantal = count($ipadr); 
$ipuser = $_SERVER['REMOTE_ADDR']; 

for($i=0; $i<=$aantal; $i++) 
{ 
    if($ipuser == "$ipadr[$i]") 
    { 
        echo "$msg_ban"; 
        exit; 
    } 
} 
?>

but do not know how to make a page where I type the ip and deve where you go = (

I hope someone can help me
Does not matter that any user can enter it as escondere the folder and file

i search but only found ban of accounts and i want ban ip
 
Something like this.. should do..
Its not tested..

Make a new file with the name ban_ips.txt
and put each ip u want to ban on a new line
in the text document

Put this ontop of ur page
PHP:
$ip  = $_SERVER['REMOTE_ADDR'];
$ipa = file('ban_ips.txt');
foreach ($ipa as $lip) {
	if ($ipa == $lip) {
		die ("Your ip : $ip doesn't have acces here");
	}
}

or you could use .htacces file's instead
to ban ip's from ur site make a file named
.htaccess (any names will do as long as it starts with .ht)
and for each ip to ban u make a new like with the folowing
Deny From <ip here>
 
Upvote 0
i understand that but i want make a web for ban ip, and my friends (Gms)
so they may also ban by ip

I explain?

am and Thankx for your answer too =D
 
Upvote 0
Try

Start > Run > type MMC press enter , u can ban a ip with that console . Take a little knowhow of how it works , but im sure u could find out :P

If need be , i can write a guide on how it works.

Btw if u wanted friends to be able to ban useing the Reg page + IP banner , settup a FTP server , soo they can use Filezilla or sumthing to download the file , add a ip , then reupload to web server.
 
Upvote 0
dosent that just stop ppl going onto your webserver tho >.< ,

the mmc console can block ips with the

"ip security Policy Management"

Which will make it seem like your server dose not exsist to who ever the ip belongs too.
 
Upvote 0
Back