1 votes
1,226 views
27 downloads
Author: admin
Posted: October 26th 2012
Did this snippet help you out? If so send this person some money!
<?php
function blacklist($ip){
$listed = true;
$dnsbl_lookup = array(
"dnsbl-1.uceprotect.net",
"dnsbl-2.uceprotect.net",
"dnsbl-3.uceprotect.net",
"dnsbl.dronebl.org",
"dnsbl.sorbs.net",
"zen.spamhaus.org"
); // Add your preferred list of DNSBL's
$lookups = count($dnsbl_lookup);
$total = 0;
if($ip){
$reverse_ip = implode(".", array_reverse(explode(".", $ip)));
foreach($dnsbl_lookup as $host){
if(checkdnsrr($reverse_ip.".".$host.".", "A")){
$total++;
}
}
}
$percent = ($total / $lookups) * 100;
if($percent >= 50){
return true;
}else{
return false;
}
}
if(blacklist($_SERVER["REMOTE_ADDR"])){
die("Your on the blacklist!");
}
// Continue with page