Jump to content

Array problem with script using PEAR Net_DNSBL


al

Recommended Posts

I'm writting simple script to test my mail server if it's listed in any of DNSBL servers and I can't get around array problem when calling $dnsbl->getDetails($serverIP).

 

It keeps adding array result line from previous server query in front of new one. In real situation DNSBL servers are pulled from MySQL. All opinions are welcome  :)

 

 

<?php
        // PEAR Net_DNSBL
        require_once 'Net/DNSBL.php';
        $dnsbl = new Net_DNSBL();

        // Test IP
        $serverIP = "127.0.0.2";
        
        // Initialize
        $rbl = $dnsbl->setBlacklists(array('b.barracudacentral.org','bl.ahbl.org'));

        // Rotate from start to end
        while ($rbl){

        // Query DNSBL servers if IP is listed
        if ($dnsbl->isListed($serverIP)) {

        // Query for details
        $detail = $dnsbl->getDetails($serverIP);

        
        // Get details out
        echo "<pre>";
        print_r($detail);
        echo "</pre>";

        } else {

        echo "NOT LISTED";

        }
}

?>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.