Author: G.Zicer (26 Apr 12 10:19am)
If you mean with foreach problem, here is what I used.
$apikey = 'xxxxxxx';
if(isset($_POST['ip_list'])) {
$ips = explode("\n", $_POST['ip_list']);
foreach($ips as $ip) {
// Honey Pot check
$what2lookup = implode('.', array_reverse(explode('.',$ip)));
$result2 = dolookup($apikey, $what2lookup);
$blocks = explode('.',$result2);
print " Honey Pot ".(($blocks[0] == 127 && $blocks[1] > 0) ? "<font color='red'>YES BLOCKED</font>" : "NOT BLOCKED" )." (".$blocks[0].".".$blocks[1].")<br />";
}
}
function dolookup($apikey,$ip){
$itman = $apikey . "." . $ip . "." . "dnsbl.httpbl.org";
$host = gethostbyname($itman);
return ($host);
}
Best regards
G.
|