Author: S.Jung2 (9 Jun 13 10:37am)
Hi,
I have some pages running with older "classical" ASP code.
Is there a way to perform this PHP script also in my ASP pages?
function httpbl_check() {
global $httpblkey, $httpblmaxdays, $httpblmaxthreat, $httpblhoneypot;
$ip = $_SERVER["REMOTE_ADDR"];
$result = explode(".", gethostbyname($httpblkey."."
.implode(".", array_reverse(explode(".", $ip)))
.".dnsbl.httpbl.org"));
if ($result[0] != 127) {
//something went wrong or the IP is not in the database.
//ignore this one.
return;
}
$days = $result[1];
$threat = $result[2];
if ($days < $httpblmaxdays && $threat > $httpblmaxthreat) {
if ($httpblhoneypot) {
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".$httpblhoneypot);
}
die();
}
}
httpbl_check();
Thanks for your feedback.
BR
Steffen
|