function fetch_html($url)
{
$ch = curl_init($url);
curl_setopt($ch,CURLOPT_REFERER, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
$code = curl_exec($ch);
curl_close($ch);
return $code;
}
function get_reply($service)
{
$html = fetch_html($service["url"]);
preg_match($service["regex"], $html, $matches);
return $service["name"]."
“;
}
$ip = $_GET["ip"];
if($ip) {
$njabl["regex"] = “/
(.*?)
/i”;
$njabl["url"] = “http://www.njabl.org/cgi-bin/lookup.cgi?query=”.$ip;
$njabl["name"] = “njabl.org”;
$spamhaus["regex"] = “/(”.$ip.”.*?SBL)/i”;
$spamhaus["url"] = “http://www.spamhaus.org/query/bl?ip=”.$ip;
$spamhaus["name"] = “spamhaus.org”;
$spamcop["regex"] = “/>(.*?bl.spamcop.net)
$spamcop["url"] = "http://www.spamcop.net/w3m?action=checkblock&ip=".$ip;
$spamcop["name"] = "spamcop.net";
echo "