PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Array problem with script using PEAR Net_DNSBL

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Networking
View previous topic :: View next topic  
Author Message
al



Joined: 17 Jun 2009
Posts: 1

PostPosted: Wed Jun 17, 2009 1:51 pm    Post subject: Array problem with script using PEAR Net_DNSBL Reply with quote

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 Very Happy

Code:

<?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";

        }
}

?>
Back to top
View user's profile Send private message
johncocyan09



Joined: 15 Jan 2010
Posts: 3

PostPosted: Fri Jan 15, 2010 3:17 pm    Post subject: Good work ! Reply with quote

thanks for posting the wonderful script, I think it would work very fine, i hope. I am also looking forward for its success.
_________________
CUBAN CIGARS
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Networking All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement

'Actiemonitor' online projectmanagement software