Hey Guys,
I'm been going crazy trying to figure this out.
First let me show you half the script
Now What I can't figure out is how to list each array that is should be displayed. The script is assumiing that only 1 array matches, so it assigns the 1 array to $bocker.PHP Code:<?php
// Retrieves the IP of the client
function getip () {
$ip="64.201.124.0";
return $ip;
}
// Queries multiple block lists
function dnsblquery ($ip) {
$dnsbllist[] = array("bl.spamcannibal.org","sbl-xbl.spamhaus.org","bl.spamcannibal.org","sbl-xbl.spamhaus.org");
if ($ip) {
// Reverses the IP
$ips = explode(".", $ip);
$ipreverse = "$ips[3].$ips[2].$ips[1].$ips[0]";
// Queries the block lists listed in dnsbllist
for ($i=0;$i<count($dnsbllist);$i++) {
if (checkdnsrr("$ipreverse.$dnsbllist[$i]", "A")) {
// Returns the blacklist the queried IP is on
return $dnsbllist[$i];
}
}
}
return FALSE;
}
$blocker = dnsblquery(getip());
But what if there are 3 arrays that match? How can I display 1, 2, 3,4 etc for as many arrays that match?
I'm not good with arrays, forgive me!
Any help is appreciated!!
Thanks!!




Bookmarks