Forum Moderators: coopster
//------------------------------------ My question is how to implent a simple redirection, say suppose if the ip is found to be black listed how to i redirect the user to a new page in my case index.php? [1][edited by: BlackRaven at 9:27 pm (utc) on Nov. 23, 2006]
$result=Array();
$dnsbl_check=array("bl.spamcop.net",
"list.dsbl.org",
"sbl.spamhaus.org");
if ($ip)
{
$quads=explode(".",$ip);
$rip=$quads[3].".".$quads[2].".".$quads.".".$quads[0];
for ($i=0; $i<count($dnsbl_check); $i++)
{
if (checkdnsrr($rip.".".$dnsbl_check[$i].".","A"))
{
$result1[]=Array($dnsbl_check[$i],$rip.".".$dnsbl_check[$i]);
}
}
}
//---------------------------
header("Location: http://www.example.com/");
or with meta or javascript, if headers are already sent
<META http-equiv="refresh" content="10;URL=http://newdomain.com">
or
<HEAD>
<SCRIPT language="JavaScript">
<!--
window.location="http://someplace.com";
//-->
</SCRIPT>
</HEAD>
Michal