Jump to content

[SOLVED] ip banning


fullyloaded

Recommended Posts

its not hard to do.

 

just create a table called banned_ips

you need fields for id, ip and date_added

 

create a function that will run on every page load to check that table for the current user's ip

 

function checkIpBan($ip){

$query = "SELECT COUNT(id) AS number FROM banned_ips WHERE ip = '". $ip ."'";

$result = mysql_query($query); //you can add the ordie cluase here if you want

$num = mysql_num_rows($result);

if($num > 0){

header("Location: banned.php");

}

}

 

that should do it for you

Link to comment
https://forums.phpfreaks.com/topic/42437-solved-ip-banning/#findComment-205870
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.