Likes Likes:  0
Resultaten 1 tot 9 van de 9
  1. #1
    whois IS voor .nl domeinen PHP script
    geregistreerd gebruiker
    270 Berichten
    Ingeschreven
    19/05/09

    Locatie
    Zoetermeer

    Post Thanks / Like
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    15 Berichten zijn liked


    Naam: appie
    Registrar SIDN: Nee
    Ondernemingsnummer: NVT

    Thread Starter

    Post whois IS voor .nl domeinen PHP script

    Beste WHTers,

    Ik ben bezig met het verbeteren van een PHP script voor het controleren van domeinen op beschikbaarheid. Nu gaat het bij de .nl vaak mis, omdat er een limiet van 15 keer per dag op zit. Ik weet dat je met "whois -h whoisserver IS domeinnaam" wel vaker kunt proberen, omdat hij dan enkel kijkt of het beschikbaar is. Ik zie alleen niet hoe ik dat in het volgende script kan verwerken:
    PHP Code:
    <?php
        
    /**
        * Class for getting converted domain name
        */
        
    require_once( 'idna/idna_convert.class.php' );

    class 
    domain extends idna_convert {
        var 
    $errnum 0;
        var 
    $domain "";

        
    /*******************************
        * Initializing server variables
        * array(top level domain,whois_Server,not_found_string or MAX number of CHARS: MAXCHARS:n)
        **/
        
    var $servers=array(
        array(
    "ac","whois.nic.ac","Available"),
        array(
    "ac.cn","whois.cnnic.net.cn","no matching record"),
        array(
    "ac.jp","whois.jprs.jp","No match"),
        array(
    "ac.uk","whois.ja.net","No such domain"),
        array(
    "ad.jp","whois.jprs.jp","No match"),
        array(
    "adm.br","whois.nic.br","No match"), // limit
        
    array("adv.br","whois.nic.br","No match"), // limit
        
    array("aero","whois.aero","NOT FOUND"),
        array(
    "ag","whois.nic.ag","NOT FOUND"),
        array(
    "agr.br","whois.nic.br","No match"), // limit
        
    array("ah.cn","whois.cnnic.net.cn","no matching record"),
        
    #array("al","whois.ripe.net","No entries found"), // info: http://www.inima.al/Domains.html
        
    array("am","whois.amnic.net","No match"),
        array(
    "am.br","whois.nic.br","No match"), // limit
        
    array("arq.br","whois.nic.br","No match"), // limit
        
    array("at","whois.nic.at","nothing found"),
        array(
    "au","whois.aunic.net","No Data Found"), // limit
        
    array("art.br","whois.nic.br","No match"), // limit
        
    array("as","whois.nic.as","Domain Not Found"),
        array(
    "asn.au","whois.aunic.net","No Data Found"),
        array(
    "ato.br","whois.nic.br","No match"), // limit
        
    array("av.tr","whois.nic.tr","No match found"),
        array(
    "az","whois.ripe.net","no entries found"),
        array(
    "ba","whois.ripe.net","No match for"),
        array(
    "bbs.tr","whois.nic.tr","No match found"),
        array(
    "be","whois.geektools.com","FREE"),
        array(
    "bel.tr","whois.nic.tr","No match found"),
        array(
    "bg","whois.digsys.bg","does not exist"),
        array(
    "bio.br","whois.nic.br","No match"), // limit
        
    array("biz","whois.biz","Not found"),
        array(
    "biz.tr","whois.nic.tr","No match found"),
        array(
    "bj.cn","whois.cnnic.net.cn","no matching record"),
        array(
    "bmd.br","whois.nic.br","No match"), // limit
        
    array("br","whois.registro.br","No match"),
        array(
    "by","whois.ripe.net","no entries found"),
        array(
    "ca","whois.cira.ca","Status: AVAIL"),
        array(
    "cc","whois.nic.cc","No match"),
        array(
    "cd","whois.cd","No match"),
        array(
    "ch","whois.nic.ch","We do not have an entry"),
        array(
    "cim.br","whois.nic.br","No match"), // limit
        
    array("ck","whois.ck-nic.org.ck","No entries found"),
        array(
    "cl","whois.nic.cl","no existe"),
        array(
    "cn","whois.cnnic.net.cn","No entries found"),
        array(
    "cng.br","whois.nic.br","No match"), // limit
        
    array("cnt.br","whois.nic.br","No match"), // limit
        
    array("com","whois.crsnic.net","No match"),
        array(
    "com.au","whois.aunic.net","No Data Found"), // limit
        
    array("com.al","whois.ripe.net","no entries found"),
        array(
    "com.br","whois.nic.br","No match"), // limit
        
    array("com.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "com.eg","whois.ripe.net","No entries found"),
        array(
    "com.hk","whois.hknic.net.hk","No Match for"),
        array(
    "com.mx","whois.nic.mx","Nombre del Dominio"),
        array(
    "com.tr","whois.nic.tr","No match found"),
        array(
    "com.ru","whois.ripn.ru","No entries found"),
        array(
    "com.tw","whois.twnic.net","NO MATCH TIP"),
        array(
    "conf.au","whois.aunic.net","No entries found"), // limit
        
    array("co.at","whois.nic.at","nothing found"),
        array(
    "co.jp","whois.nic.ad.jp","No match"),
        array(
    "co.uk","whois.nic.uk","No match for"),
        
    //array("co.za","co.za","No Matches"),
        
    array("cq.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "csiro.au","whois.aunic.net","No Data Found"), // limit
        
    array("cx","whois.nic.cx","No match"),
        array(
    "cy","whois.ripe.net","no entries found"),
        array(
    "cz","whois.nic.cz","No data found"),
        array(
    "de","whois.denic.de","not found"),
        array(
    "dr.tr","whois.nic.tr","No match found"),
        array(
    "dk","whois.dk-hostmaster.dk","No entries found"),
        array(
    "dz","whois.ripe.net","no entries found"),
        array(
    "ecn.br","whois.nic.br","No match"), // limit
        
    array("ee","whois.eenet.ee","NOT FOUND"),
        
    // array("edu","whois.verisign-grs.net","No match"),
        
    array("edu","whois.crsnic.net","No match"),
        array(
    "edu.au","whois.aunic.net","No Data Found"), // limit
        
    array("edu.br","whois.nic.br","No match"), // limit
        
    array("edu.tr","whois.nic.tr","No match found"),
        array(
    "eg","whois.ripe.net","No entries found"),
        array(
    "es","whois.ripe.net","No entries found"),
        array(
    "esp.br","whois.nic.br","No match"), // limit
        
    array("etc.br","whois.nic.br","No match"), // limit
        
    array("eti.br","whois.nic.br","No match"), // limit
        
    array("eun.eg","whois.ripe.net","No entries found"),
        array(
    "emu.id.au","whois.aunic.net","No Data Found"), // limit
        
    array("eng.br","whois.nic.br","No match"), // limit
        
    array("eu","whois.eu","Status: AVAILABLE"),
        array(
    "far.br","whois.nic.br","No match"), // limit
        
    array("fi","whois.ripe.net","No entries found"),
        array(
    "fj","whois.usp.ac.fj",""),
        array(
    "fj.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "fm.br","whois.nic.br","No match"), // limit
        
    array("fnd.br","whois.nic.br","No match"), // limit
        
    array("fo","whois.ripe.net","no entries found"),
        array(
    "fot.br","whois.nic.br","No match"), // limit
        
    array("fst.br","whois.nic.br","No match"), // limit
        
    array("fr","whois.nic.fr","No entries found"),
        array(
    "gb","whois.ripe.net","No match for"),
        array(
    "gb.com","whois.nomination.net","No match for"),
        array(
    "gb.net","whois.nomination.net","No match for"),
        array(
    "g12.br","whois.nic.br","No match"), // limit
        
    array("gd.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "ge","whois.ripe.net","no entries found"),
        array(
    "gen.tr","whois.nic.tr","No match found"),
        array(
    "ggf.br","whois.nic.br","No match"), // limit
        
    array("gl","whois.ripe.net","no entries found"),
        array(
    "gr","whois.ripe.net","no entries found"),
        array(
    "gr.jp","whois.nic.ad.jp","No match"),
        array(
    "gs","whois.adamsnames.tc","is not registered"),
        array(
    "gs.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "gov.au","whois.aunic.net","No Data Found"), // limit
        
    array("gov.br","whois.nic.br","No match"), // limit
        
    array("gov.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "gov.hk","whois.hknic.net.hk","No Match for"),
        array(
    "gov.tr","whois.nic.tr","No match found"),
        array(
    "gob.mx","whois.nic.mx","Nombre del Dominio"),
        array(
    "gs","whois.adamsnames.tc","is not registered"),
        array(
    "gz.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "gx.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "he.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "ha.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "hb.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "hi.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "hl.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "hn.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "hm","whois.registry.hm","(null)"),
        array(
    "hk","whois.hknic.net.hk","No Match for"),
        array(
    "hk.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "hu","whois.ripe.net","MAXCHARS:500"),
        array(
    "id.au","whois.aunic.net","No Data Found"), // limit
        
    array("ie","whois.domainregistry.ie","no match"),
        array(
    "in","whois.inregistry.net","NOT FOUND"),
        array(
    "ind.br","whois.nic.br","No match"), // limit
        
    array("imb.br","whois.nic.br","No match"), // limit
        
    array("inf.br","whois.nic.br","No match"), // limit
        
    array("info","whois.afilias.info","NOT FOUND"),
        array(
    "info.au","whois.aunic.net","No Data Found"), // limit
        
    array("info.tr","whois.nic.tr","No match found"),
        array(
    "it","whois.nic.it","AVAILABLE"),
        array(
    "idv.tw","whois.twnic.net","NO MATCH TIP"),
        array(
    "int","whois.iana.org","not found"),
        array(
    "is","whois.isnic.is","No entries found"),
        array(
    "il","whois.isoc.org.il","No data was found"),
        array(
    "jl.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "jor.br","whois.nic.br","No match"), // limit
        
    array("jp","whois.nic.ad.jp","No match"),
        array(
    "js.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "jx.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "k12.tr","whois.nic.tr","No match found"),
        array(
    "ke","whois.rg.net","No match for"),
        array(
    "kr","whois.krnic.net","is not registered"),
        array(
    "la","whois.nic.la","NO MATCH"),
        array(
    "lel.br","whois.nic.br","No match"), // limit
        
    array("li","whois.nic.ch","We do not have an entry"),
        array(
    "lk","whois.nic.lk","No domain registered"),
        array(
    "ln.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "lt","ns.litnet.lt","No matches found"),
        array(
    "lu","whois.dns.lu","No entries found"),
        array(
    "lv","whois.ripe.net","no entries found"),
        array(
    "ltd.uk","whois.nic.uk","No match for"),
        array(
    "ma","whois.ripe.net","No entries found"),
        array(
    "mat.br","whois.nic.br","No match"), // limit
        
    array("mc","whois.ripe.net","No entries found"),
        array(
    "md","whois.ripe.net","No match for"),
        array(
    "me.uk","whois.nic.uk","No match for"),
        array(
    "med.br","whois.nic.br","No match"), // limit
        
    array("mil","whois.nic.mil","No match"),
        array(
    "mil.br","whois.nic.br","No match"), // limit
        
    array("mil.tr","whois.nic.tr","No match found"),
        array(
    "mk","whois.ripe.net","No match for"),
        array(
    "mn","whois.nic.mn","Domain not found"),
        array(
    "mo.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "ms","whois.adamsnames.tc","is not registered"),
        array(
    "mt","whois.ripe.net","No Entries found"),
        array(
    "mus.br","whois.nic.br","No match"), // limit
        
    array("mx","whois.nic.mx","Nombre del Dominio"),
        array(
    "name","whois.nic.name","No match"),
        array(
    "name.tr","whois.nic.tr","No match found"),
        array(
    "ne.jp","whois.nic.ad.jp","No match"),
        array(
    "net","whois.crsnic.net","No match"),
        array(
    "net.au","whois.aunic.net","No Data Found"), // limit
        
    array("net.br","whois.nic.br","No match"), // limit
        
    array("net.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "net.eg","whois.ripe.net","No entries found"),
        array(
    "net.hk","whois.hknic.net.hk","No Match for"),
        array(
    "net.lu","whois.dns.lu","No entries found"),
        array(
    "net.mx","whois.nic.mx","Nombre del Dominio"),
        array(
    "net.uk","whois.nic.uk","No match for "),
        array(
    "net.ru","whois.ripn.ru","No entries found"),
        array(
    "net.tr","whois.nic.tr","No not found"),
        array(
    "net.tw","whois.twnic.net","NO MATCH TIP"),
        array(
    "nl","","free"),
        array(
    "nm.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "no","whois.norid.no","no matches"),
        array(
    "no.com","whois.nomination.net","No match for"),
        array(
    "nom.br","whois.nic.br","No match"), // limit
        
    array("not.br","whois.nic.br","No match"), // limit
        
    array("ntr.br","whois.nic.br","No match"), // limit
        
    array("nu","whois.nic.nu","NO MATCH for"),
        array(
    "nx.cn","whois.cnnic.net.cn","no matching record"),
        array(
    "nz","whois.domainz.net.nz","Not Listed"),
        array(
    "plc.uk","whois.nic.uk","No match for"),
        array(
    "odo.br","whois.nic.br","No match"), // limit
        
    array("oop.br","whois.nic.br","No match"), // limit
        
    array("or.jp","whois.nic.ad.jp","No match"),
        array(
    "or.at","whois.nic.at","nothing found"),
        array(
    "org","whois.pir.org","NOT FOUND"),
        array(
    "org.au","whois.aunic.net","No Data Found"), // limit
        
    array("org.br","whois.nic.br","No match"), // limit
        
    array("org.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "org.hk","whois.hknic.net.hk","No Match for"),
        array(
    "org.lu","whois.dns.lu","No entries found"),
        array(
    "org.ru","whois.ripn.ru","No entries found"),
        array(
    "org.tr","whois.nic.tr","No match found"),
        array(
    "org.tw","whois.twnic.net","NO MATCH TIP"),
        array(
    "org.uk","whois.nic.uk","No match for"),
        
    // array("org.za","org.za","Domain not registered"),
        
    array("pk","whois.pknic.net","is not registered"),
        array(
    "pl","whois.ripe.net","No information about"),
        array(
    "pol.tr","whois.nic.tr","No match found"),
        array(
    "pp.ru","whois.ripn.ru","No entries found"),
        array(
    "ppg.br","whois.nic.br","No match"), // limit
        
    array("pro.br","whois.nic.br","No match"), // limit
        
    array("psi.br","whois.nic.br","No match"), // limit
        
    array("psc.br","whois.nic.br","No match"), // limit
        
    array("pt","whois.ripe.net","No match for"),
        array(
    "qh.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "qsl.br","whois.nic.br","No match"), // limit
        
    array("rec.br","whois.nic.br","No match"), // limit
        
    array("ro","whois.ripe.net","No entries found"),
        array(
    "ru","whois.ripn.ru","No entries found"),
        array(
    "sc.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "sd.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "se","whois.nic-se.se","No data found"),
        array(
    "se.com","whois.nomination.net","No match for"),
        array(
    "se.net","whois.nomination.net","No match for"),
        array(
    "sg","whois.nic.net.sg","NO entry found"),
        array(
    "sh","whois.nic.sh","No match for"),
        array(
    "sh.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "si","whois.arnes.si","No entries found"),
        array(
    "sk","whois.ripe.net","no entries found"),
        array(
    "slg.br","whois.nic.br","No match"), // limit
        
    array("sm","whois.ripe.net","no entries found"),
        array(
    "sn.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "srv.br","whois.nic.br","No match"), // limit
        
    array("st","whois.nic.st","No entries found"),
        array(
    "su","whois.ripe.net","No entries found"),
        array(
    "sx.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "tc","whois.adamsnames.tc","is not registered"),
        array(
    "tel.tr","whois.nic.tr","No match found"),
        array(
    "th","whois.nic.uk","No entries found"),
        array(
    "tj.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "tm","whois.nic.tm","No match for"),
        array(
    "tn","whois.ripe.net","No entries found"),
        array(
    "tmp.br","whois.nic.br","No match"), // limit
        
    array("to","whois.tonic.to","No match"),
        array(
    "trd.br","whois.nic.br","No match"), // limit
        
    array("tur.br","whois.nic.br","No match"), // limit
        
    array("tv","whois.nic.tv","MAXCHARS:75"),
        array(
    "tv.br","whois.nic.br","No match"), // limit
        
    array("tv.tr","whois.nic.tr","No match found"),
        array(
    "tw","whois.twnic.net","NO MATCH TIP"),
        array(
    "tw.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "ua","whois.ripe.net","No entries found"),
        array(
    "uk","whois.thnic.net","No match for"),
        array(
    "uk.com","whois.nomination.net","No match for"),
        array(
    "uk.net","whois.nomination.net","No match for"),
        array(
    "us","whois.nic.us","Not found"),
        array(
    "va","whois.ripe.net","No entries found"),
        array(
    "vet.br","whois.nic.br","No match"), // limit
        
    array("vg","whois.adamsnames.tc","is not registered"),
        array(
    "wattle.id.au","whois.aunic.net","No Data Found"), // limit
        
    array("web.tr","whois.nic.tr","No match found"),
        array(
    "ws","whois.worldsite.ws","No match for"),
        array(
    "xj.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "xz.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "yn.cn","whois.cnnic.net.cn","No entries found"),
        array(
    "yu","whois.ripe.net","No entries found"),
        array(
    "za","whois.frd.ac.za","No match for"),
        array(
    "zlg.br","whois.nic.br","No match"), // limit
        
    array("zj.cn","whois.cnnic.net.cn","No entries found")
        );

        var 
    $idn = array( 224,225,226,227,228,229,230,231,232,233,234,235,240,236,237,238,239,241,242,243,244,245,246,248,254,249,250,251,252,253,255 );

        
    /**
        * Constructor of class domain
        * @param string $str_domainame the full name of the domain
        * @desc Constructor of class domain
        */
        
    function domain$str_domainname ) {
            
    $this->domain $str_domainname;
            
    $this->idna_convert();
        }

        
    /**
        * Returns the error code
        * 0 - no error
        * 1 - domain not valid
        * 2 - tld not in list
        * 3 - error on connection to whois server
        * @return integer $errnum Error Code
        * @desc Returns the error code
        */
        
    function errnum() {
            return 
    $this->errnum;
        }

        
    /**
        * Sets the error code
        *@param integer $errnum Error Code
        *@desc Sets the error code
        */
        
    function error$errnum ) {
            
    $this->errnum $errnum;
        }

        
    /**
        * Returns the whois data of the domain
        * @return string $whoisdata Whois data as string
        * @desc Returns the whois data of the domain
        */
        
    function info() {
            if( 
    $this->is_valid() ) {
                
    $tldname $this->get_tld();
                
    $domainname $this->get_domain();
                
    $whois_server $this->get_whois_server();

                
    // If tldname have been found
                
    if( $whois_server !== "" ) {
                    
    $dom $domainname"." .$tldname;
                    
    // convert to lower case if not yet done
                    
    $dom strtolower$dom );
                    
    // convert domainname
                    
    $convdom $this->encodeutf8_encode$dom ) );

                    
    $timeout 30;
                    
    #$errno = 0;
                    
    $errstr '';

                    if( 
    $tldname == 'co.za' ) {
                        
    // Getting whois information
                        
    $fp = @fsockopen$whois_server80$errno$errstr$timeout );
                        if( 
    $fp ) {
                            
    socket_set_timeout$fp$timeout );

                            
    $cmd  "GET /cgi-bin/whois.sh?Domain=$dom HTTP/1.0\r\n";
                            
    $cmd .= "Host: co.za\r\n";
                            
    $cmd .= "Connection: Keep-Alice\r\n";
                            
    $cmd .= "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705)\r\n";
                            
    $cmd .= "Referer: http://co.za/whois.shtml\r\n";
                            
    $cmd .= "Accept: text/plain, text/html\r\n";
                            
    $cmd .= "\r\n";

                            
    fputs$fp$cmd );

                            
    $string "";
                            while( !
    feof$fp ) ) {
                                
    $string.=fgets($fp,128);
                            }

                            
    $string strip_tags$string );
                            
    $string strstr$string"Search on" );
                        } else {
                            
    $this->errnum 3;
                        }
                    } elseif( 
    $tldname == 'org.za' ) {
                        
    // Getting whois information
                        
    $fp = @fsockopen$whois_server80$errno$errstr$timeout );
                        if( 
    $fp ) {
                            
    socket_set_timeout$fp$timeout );

                            
    $cmd  "GET /cgi-bin/rwhois?domain=$dom&format=dump HTTP/1.0\r\n";
                            
    $cmd .= "Host: co.org\r\n";
                            
    $cmd .= "Connection: Keep-Alice\r\n";
                            
    $cmd .= "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705)\r\n";
                            
    $cmd .= "Referer: http://org.za/\r\n";
                            
    $cmd .= "Accept: text/plain, text/html\r\n";
                            
    $cmd .= "\r\n";

                            
    fputs$fp$cmd );

                            
    $string "";
                            while(!
    feof($fp)){
                                
    $string.=fgets($fp,128);
                            }

                            
    $string strstr$string"search on" );
                            
    $split split"</PRE>"$string );
                            
    $string $split[0];
                            
    $string strip_tags$string );
                            
    $string trim($string);
                        }
                    } else {
                        
    // Getting whois information
                        
    $fp = @fsockopen$whois_server43$errnum$errstr$timeout );
                        if( 
    $fp ) {

                            
    $dom $domainname"." .$tldname;

                            
    // New IDN
                            
    if( $tldname == "de" ) {
                                
    fputs$fp"-C ISO-8859-1 -T dn $dom\r\n" );
                           }  elseif( 
    $tldname == "nl" ) {
                                
    fputs$fp"IS $convdom\r\n" );
                            } else {
                                
    fputs$fp"$convdom\r\n" );
                            }

                            
    // Getting string
                            
    $string "";

                    
    // Checking whois server for .com and .net
                    
    if($tldname=="com" || $tldname=="net" || $tldname=="edu"){
                        while(!
    feof($fp)){
                            
    $line=trim(fgets($fp,128));
                            
    $string.=$line;
                            
    $lineArr=split(":",$line);
                            if(
    strtolower($lineArr[0])=="whois server"){
                                
    $whois_server=trim($lineArr[1]);
                            }
                        }
                        
    // Getting whois information
                        
    $fp fsockopen($whois_server,43);

                        
    $dom=$domainname.".".$tldname;
                        
    fputs($fp"$convdom\r\n");

                        
    // Getting string
                        
    $string="";

                        while(!
    feof($fp)){
                            
    $string.=fgets($fp,128);
                        }

                    
    // Checking for other tld's
                    
    }else{

                            while(!
    feof($fp)){
                                
    $string.=fgets($fp,128);
                            }
                    }
                            
    fclose$fp );
                        } else {
                            
    $this->error(3);
                        }
                    }

                    return 
    $string;
                }else{
                    
    $this->error(2);
                    return 
    "No whois server for this tld in list!";
                }
            }else{
                
    $this->error(1);
                return 
    "Domainname isn't valid!";
            }
        }

        
    /**
        * Returns the whois data of the domain in HTML format
        * @return string $whoisdata Whois data as string in HTML
        * @desc Returns the whois data of the domain  in HTML format
        */
        
    function html_info() {
            return 
    nl2br$this->info() );
        }

        
    /**
        * Returns name of the whois server of the tld
        * @return string $server the whois servers hostname
        * @desc Returns name of the whois server of the tld
        */
        
    function get_whois_server() {
            
    $found false;
            
    $tldname $this->get_tld();
            for( 
    $i 0$i count$this->servers ); $i++ ){
                if( 
    $this->servers[$i][0] == $tldname ){
                    
    $server $this->servers[$i][1];
                    
    #$full_dom = $this->servers[$i][3];
                    
    $found true;
                }
            }
            return 
    $server;
        }

        
    /**
        * Returns the tld of the domain without domain name
        * @return string $tldname the tlds name without domain name
        * @desc Returns the tld of the domain without domain name
        */
        
    function get_tld() {
            
    // Splitting domainname
            
    $domain split"\."$this->domain );
            if( 
    count$domain ) > ) {
                
    $domainname $domain[0];
                for( 
    $i 1$i count$domain ); $i++ ){
                    if( 
    $i == ){
                        
    $tldname $domain[$i];
                    } else {
                        
    $tldname .= "." .$domain[$i];
                    }
                }
            } else {
                
    $domainname $domain[0];
                
    $tldname $domain[1];
            }
            return 
    $tldname;
        }


        
    /**
        * Returns all tlds which are supported by the class
        * @return array $tlds all tlds as array
        * @desc Returns all tlds which are supported by the class
        */
        
    function get_tlds() {
            
    $tlds="";
            for( 
    $i 0$i count$this->servers ); $i++ ){
                
    $tlds[$i] = $this->servers[$i][0];
            }
            return 
    $tlds;
        }

        
    /**
        * Returns the name of the domain without tld
        * @return string $domain the domains name without tld name
        * @desc Returns the name of the domain without tld
        */
        
    function get_domain() {
            
    // Splitting domainname
            
    $domain split"\."$this->domain );
            return 
    $domain[0];
        }

        
    /**
        * Returns the full domain
        * @return string $fulldomain
        * @desc Returns the full domain
        */
        
    function get_fulldomain() {
            return 
    $this->domain;
        }

        
    /**
        * Returns the string which will be returned by the whois server of the tld if a domain is avalable
        * @return string $notfound  the string which will be returned by the whois server of the tld if a domain is avalable
        * @desc Returns the string which will be returned by the whois server of the tld if a domain is avalable
        */
        
    function get_notfound_string() {
            
    $found false;
            
    $tldname $this->get_tld();
            for( 
    $i 0$i count$this->servers ); $i++ ) {
                if( 
    $this->servers[$i][0] == $tldname ) {
                    
    $notfound $this->servers[$i][2];
                }
            }
            return 
    $notfound;
        }

        
    /**
        * Returns if the domain is available for registering
        * @return boolean $is_available Returns 1 if domain is available and 0 if domain isn't available
        * @desc Returns if the domain is available for registering
        */
        
    function is_available() {
    /* Adaptation for Webhosting Component for Joomla! */
            
    global $params;
            if(
    defined'_VALID_MOS' ) && isset($params)) {
                
    $tldarray=explode(',',$params->get('ignoredtlds'));
                if(
    in_array($this->get_tld(), $tldarray)) {
                    return 
    true;
                } else {
                }
            }
    /* End of Adaptation for Webhosting Component for Joomla! */
            
    $whois_string=$this->info(); // Gets the entire WHOIS query from registrar
            
    $not_found_string=$this->get_notfound_string(); // Gets 3rd item from array
            
    $domain=$this->domain// Gets current domain being queried

            
    $whois_string2=@ereg_replace("$domain","",$whois_string);

            
    $whois_string =@preg_replace("/\s+/"," ",$whois_string); //Replace whitespace with single space

            
    $array=split(":",$not_found_string);

            if(
    $array[0]=="MAXCHARS"){
                if(
    strlen($whois_string2)<=$array[1]){
                    return 
    true;
                }else{
                    return 
    false;
                }
            }else{
                if(
    preg_match("/".$not_found_string."/",$whois_string)){
                    return 
    true;
                }else{
                    return 
    false;
                }
            }
        }

        
    /**
        * Returns if the domain name is valid
        * @return boolean $is_valid Returns 1 if domain is valid and 0 if domain isn't valid
        * @desc Returns if the domain name is valid
        */
        
    function is_valid() {

            
    $domainArr split"\."$this->domain );

            
    // If it's a tld with two Strings (like co.uk)
            
    if( count$domainArr ) == ){

                
    $tld $domainArr[1]. "." .$domainArr[2];
                
    $found false;

                for( 
    $i 0$i count$this->servers ) && $found == false$i++ ) {
                    if( 
    $this->servers[$i][0] == $tld ) {
                        
    $found true;
                    }
                }
                if( !
    $found ){
                    return 
    false;
                }

            } elseif( 
    count$domainArr ) > ){
                return 
    false;
            }

            
    // Creating regular expression for
            
    if( $this->get_tld() == "de" ) {
            
    $idn '';
                for( 
    $i=0$i count$this->idn ); $i++ ){
                    
    $idn .= chr$this->idn[$i] );
                }
                
    $pattern"^[a-z" .$idn"0-9\-]{3,}$";
            } else {
                
    $pattern "^[a-z0-9\-]{3,}$";
            }

            
    // Use of converted form here if not tld == de
            
    $domain strtolower$this->get_domain() );
            if( 
    $this->get_tld() == "de" ){
                
    $check_dom $domain;
            } else {
                
    $check_dom $this->encodeutf8_encode$domain ) );
            }

            
    // Use complex checks here, because "--" in domain is valid if converted form AND starting with "xn--"
            
    if( ereg$pattern$check_dom ) && !ereg"^-|-$"$check_dom ) ) {
                if( !
    preg_match"/--/"$check_dom ) ) {
                    return 
    true;
                } else {
                    if ( 
    preg_match"/xn--/"$check_dom) ) {
                        return 
    true;
                    } else {
                        return 
    false;
                    }
                }
            }else{
                return 
    false;
            }
        }
    }
    ?>
    En het volgende heb ik links op de website:
    PHP Code:
    <?php

    // no direct access
    defined('_JEXEC') or die('Restricted access');

    $label        $params->get'label''' );
    $buttontext        $params->get'buttontext''' );
    $resulttext        $params->get'resulttext''' );
    $checkall        $params->get'checkall''' );
    $pretext        $params->get'pretext''' );
    $forwardurl        $params->get'forwardurl''' );
    $s5_domain1        $params->get's5_domain1''' );
    $s5_break1        $params->get's5_break1''' );
    $s5_domain2        $params->get's5_domain2''' );
    $s5_break2        $params->get's5_break2''' );
    $s5_domain3        $params->get's5_domain3''' );
    $s5_break3        $params->get's5_break3''' );
    $s5_domain4        $params->get's5_domain4''' );
    $s5_break4        $params->get's5_break4''' );
    $s5_domain5        $params->get's5_domain5''' );
    $s5_break5        $params->get's5_break5''' );
    $s5_domain6        $params->get's5_domain6''' );
    $s5_break6        $params->get's5_break6''' );
    $s5_domain7        $params->get's5_domain7''' );
    $s5_break7        $params->get's5_break7''' );
    $s5_domain8        $params->get's5_domain8''' );
    $s5_break8        $params->get's5_break8''' );
    $s5_domain9        $params->get's5_domain9''' );
    $s5_break9        $params->get's5_break9''' );
    $s5_domain10    $params->get's5_domain10''' );
    $s5_break10        $params->get's5_break10''' );
    $s5_domain11    $params->get's5_domain11''' );
    $s5_break11        $params->get's5_break11''' );
    $s5_domain12    $params->get's5_domain12''' );
    $s5_break12        $params->get's5_break12''' );
    $s5_domain13    $params->get's5_domain13''' );
    $s5_break13        $params->get's5_break13''' );
    $s5_domain14    $params->get's5_domain14''' );
    $s5_break14        $params->get's5_break14''' );
    $s5_domain15    $params->get's5_domain15''' );
    $s5_break15        $params->get's5_break15''' );

    ?>

    <?php if ($pretext != "") { ?>
    <div style="margin-bottom:8px">
    <?php echo $pretext ?>
    </div>
    <?php ?>

    <?php

        
    function checkDomain($domain,$server,$findText){
            
    // Open a socket connection to the whois server
            
    $con fsockopen($server43);
            if (!
    $con) return false;
            
            
    // Send the requested doman name
               
            
    fputs($con$domain."\r\n");
            
            
    // Read and store the server response
            
    $response ' :';
            while(!
    feof($con)) {
                
    $response .= fgets($con,128); 
            }
            
            
    // Close the connection
            
    fclose($con);
            
            
    // Check the response stream whether the domain is available
            // echo $response;
            
    if (strpos($response$findText)){
            
                return 
    true;
            }
            else {
                return 
    false;   
            }
        }
        
        function 
    showDomainResult($domain,$server,$findText){
        
           if (
    checkDomain($domain,$server,$findText)){
              echo 
    "<div style='margin-bottom:4px'>$domain Vrij</div>";
           }
           else echo 
    "<div style='margin-bottom:4px'>$domain Bezet</div>";
        }
        
    ?>

        <div id="main">
          <form action="<?php echo $forwardurl ?>" method="post" name="domain" id="domain">
          <span style="font-weight:bold">
            <?php echo $label ?> :
          </span>
            <div style="margin-top:8px; margin-bottom:8px">
                    <input class="text" name="domainname" type="text" />
            </div>
            <div style="margin-top:8px; margin-bottom:8px">
            <div style="margin-bottom:8px">
                    <input type="checkbox" name="all" checked="checked"/> <?php echo $checkall ?>
            </div>
            </div>
                    <input class="button" type="submit" name="submitBtn" value="<?php echo $buttontext ?>"/>
          </form>

          
    <?php    
        
    if (isset($_POST['submitBtn'])){
            
    $domainbase = (isset($_POST['domainname'])) ? $_POST['domainname'] : '';
            
    $d_all      = (isset($_POST['all'])) ? 'all' '';   
            
            if (
    $s5_domain1 == "yes") {
            
    $d_com      = (isset($_POST['com'])) ? 'com' ''
            }        
            
            if (
    $s5_domain2 == "yes") {
            
    $d_net      = (isset($_POST['net'])) ? 'net' ''
            }    
            
            if (
    $s5_domain3 == "yes") {
            
    $d_info      = (isset($_POST['info'])) ? 'info' ''
            }       
            
            if (
    $s5_domain4 == "yes") {
            
    $d_org      = (isset($_POST['org'])) ? 'org' ''
            }    
            
            if (
    $s5_domain5 == "yes") {
            
    $d_biz      = (isset($_POST['biz'])) ? 'biz' ''
            }
            
            if (
    $s5_domain6 == "yes") {
            
    $d_couk      = (isset($_POST['couk'])) ? 'couk' ''
            }
            
            if (
    $s5_domain7 == "yes") {
            
    $d_name      = (isset($_POST['name'])) ? 'name' ''
            }
            
            if (
    $s5_domain8 == "yes") {
            
    $d_cc      = (isset($_POST['cc'])) ? 'cc' ''
            }
            
            if (
    $s5_domain9 == "yes") {
            
    $d_us      = (isset($_POST['us'])) ? 'us' ''
            }
            
            if (
    $s5_domain10 == "yes") {
            
    $d_tv      = (isset($_POST['tv'])) ? 'tv' ''
            }
            
            if (
    $s5_domain11 == "yes") {
            
    $d_eu      = (isset($_POST['eu'])) ? 'eu' ''
            }
            
            if (
    $s5_domain12 == "yes") {
            
    $d_edu      = (isset($_POST['edu'])) ? 'edu' ''
            }
            
            if (
    $s5_domain13 == "yes") {
            
    $d_mobi      = (isset($_POST['mobi'])) ? 'mobi' ''
            }
            
            if (
    $s5_domain14 == "yes") {
            
    $d_nl      = (isset($_POST['nl'])) ? 'nl' ''
            }
            
            if (
    $s5_domain15 == "yes") {
            
    $d_ca      = (isset($_POST['ca'])) ? 'ca' ''
            }
            
            
    // Check domains only if the base name is big enough
            
    if (strlen($domainbase)>0){
    ?>
          <div id="caption" style="margin-top:8px; margin-bottom:8px; font-weight:bold"><?php echo $resulttext ?> :</div>
          <div id="result">

    <?php        

                
    if ($s5_domain14 == "yes") {
                if ((
    $d_nl != '') || ($d_all != '') ) showDomainResult($domainbase.".nl",'whois.domain-registry.nl','free');
                }

                if (
    $s5_domain1 == "yes") {
                if ((
    $d_com != '') || ($d_all != '') ) showDomainResult($domainbase.".com",'whois.crsnic.net','No match for');
                }    
                
                if (
    $s5_domain2 == "yes") {
                if ((
    $d_net != '') || ($d_all != '') ) showDomainResult($domainbase.".net",'whois.crsnic.net','No match for');
                }    
                
                if (
    $s5_domain3 == "yes") {
                if ((
    $d_info != '') || ($d_all != '') ) showDomainResult($domainbase.".info",'whois.afilias.net','NOT FOUND');
                }    
                
                if (
    $s5_domain4 == "yes") {
                if ((
    $d_org != '') || ($d_all != '') ) showDomainResult($domainbase.".org",'whois.publicinterestregistry.net','NOT FOUND');
                }    
                
                if (
    $s5_domain5 == "yes") {
                if ((
    $d_biz != '') || ($d_all != '') ) showDomainResult($domainbase.".biz",'whois.neulevel.biz','Not found:');
                }    
                
                if (
    $s5_domain6 == "yes") {
                if ((
    $d_couk != '') || ($d_all != '') ) showDomainResult($domainbase.".co.uk",'whois.nic.uk','No match for');
                }    
                
                if (
    $s5_domain7 == "yes") {
                if ((
    $d_name != '') || ($d_all != '') ) showDomainResult($domainbase.".name",'whois.nic.name','No match');
                }    
                
                if (
    $s5_domain8 == "yes") {
                if ((
    $d_cc != '') || ($d_all != '') ) showDomainResult($domainbase.".cc",'whois.nic.cc','No match');
                }    
                
                if (
    $s5_domain9 == "yes") {
                if ((
    $d_us != '') || ($d_all != '') ) showDomainResult($domainbase.".us",'whois.nic.us','Not found:');
                }
                
                if (
    $s5_domain10 == "yes") {
                if ((
    $d_tv != '') || ($d_all != '') ) showDomainResult($domainbase.".tv",'whois.nic.tv','No match for');
                }
                
                if (
    $s5_domain11 == "yes") {
                if ((
    $d_eu != '') || ($d_all != '') ) showDomainResult($domainbase.".eu",'whois.eu','AVAILABLE');
                }
                
                if (
    $s5_domain12 == "yes") {
                if ((
    $d_edu != '') || ($d_all != '') ) showDomainResult($domainbase.".edu",'whois.crsnic.net','No match for');
                }
                
                if (
    $s5_domain13 == "yes") {
                if ((
    $d_mobi != '') || ($d_all != '') ) showDomainResult($domainbase.".mobi",'whois.dotmobiregistry.net','NOT FOUND');
                }
                
                if (
    $s5_domain15 == "yes") {
                if ((
    $d_ca != '') || ($d_all != '') ) showDomainResult($domainbase.".ca",'whois.cira.ca','AVAIL');
                }

    ?>

         </div>
    <?php            
            
    }
        }
    ?>    

        </div>
    Website is www.gratishostingwebsite.nl

    (belangrijk dat alleen .nl met IS opgezocht wordt!!!)

  2. #2
    whois IS voor .nl domeinen PHP script
    moderator
    7.022 Berichten
    Ingeschreven
    29/07/03

    Locatie
    Nijmegen

    Post Thanks / Like
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    175 Berichten zijn liked


    Naam: Mike
    Bedrijf: admin.nu
    URL: www.admin.nu
    Registrar SIDN: Ja
    KvK nummer: 09139651

    en wat werkt er niet ? Voor de nl staat er al een exceptie in dat hij queried met IS ervoor.
    "Zo zijn ook wij één leverancier. Dé leverancier in gedegen Linux kennis, wanneer jij dat nodig hebt."
    Boek je admin vandaag nog via : www.admin.nu
    Gevestigd in Nederland en Moldavië

    Lees hier de webhostingtalk.nl forum regels en voorwaarden!

  3. #3
    whois IS voor .nl domeinen PHP script
    geregistreerd gebruiker
    270 Berichten
    Ingeschreven
    19/05/09

    Locatie
    Zoetermeer

    Post Thanks / Like
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    15 Berichten zijn liked


    Naam: appie
    Registrar SIDN: Nee
    Ondernemingsnummer: NVT

    Thread Starter
    Zojuist 15 pogingen gedaan, nu geeft hij .nl weer als bezet aan omdat hij een fout terug krijgt. Ik heb het getest met het 2e script.

  4. #4
    whois IS voor .nl domeinen PHP script
    Web hosting diensten
    4.705 Berichten
    Ingeschreven
    09/02/04

    Locatie
    Rotterdam

    Post Thanks / Like
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    110 Berichten zijn liked


    Bedrijf: DreamHost.nl Web hosting
    Functie: Managing Director
    URL: www.dreamhost.nl
    Registrar SIDN: JA
    KvK nummer: 24269577

    Er zit ook geen foutafhandeling in je scripts, dus dat is logisch. Ook als de Whois tijdelijk niet bereikbaar is (en dat komt best wel vaak voor), zal de domeinnaam altijd geregistreerd zijn. Dat is enige waar op wordt gecontroleerd.
    DreamHost.nl Web hosting - cPanel hosting om bij weg te dromen.

  5. #5
    whois IS voor .nl domeinen PHP script
    geregistreerd gebruiker
    270 Berichten
    Ingeschreven
    19/05/09

    Locatie
    Zoetermeer

    Post Thanks / Like
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    15 Berichten zijn liked


    Naam: appie
    Registrar SIDN: Nee
    Ondernemingsnummer: NVT

    Thread Starter
    Maar die fout hoeft niet te komen als er een IS gedaan wordt. Dit moet ik simpelweg in het 2e script zien te verwerken. Volgens mij doet de eerste het wel, maar dat weet ik niet zeker. Ik heb nu weer wat aanpassingen gemaakt, morgen even testen:
    if( $server == "whois.domain-registry.nl" ) {
    fputs($con, "IS $domain\r\n");
    } else {
    fputs($con, $domain."\r\n");
    }

    EDIT:
    http://www.24x7hosting.nl/producten doet het nu! Zelfde script met deze aanpassing.

    // Send the requested doman name
    if( $server == "whois.domain-registry.nl" ) {
    fputs($con, "is $domain\r\n");
    } else {
    fputs($con, $domain."\r\n");
    }
    Laatst gewijzigd door 24x7hosting; 08/03/10 om 16:48.

  6. #6
    whois IS voor .nl domeinen PHP script
    geregistreerd gebruiker
    270 Berichten
    Ingeschreven
    19/05/09

    Locatie
    Zoetermeer

    Post Thanks / Like
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    15 Berichten zijn liked


    Naam: appie
    Registrar SIDN: Nee
    Ondernemingsnummer: NVT

    Thread Starter
    En voor de mensen die het eerste script niet werkend krijgen met .nl:
    array("nl","","free"),
    moet zijn:
    array("nl","whois.domain-registry.nl","free"),

  7. #7
    whois IS voor .nl domeinen PHP script
    Web hosting diensten
    4.705 Berichten
    Ingeschreven
    09/02/04

    Locatie
    Rotterdam

    Post Thanks / Like
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    110 Berichten zijn liked


    Bedrijf: DreamHost.nl Web hosting
    Functie: Managing Director
    URL: www.dreamhost.nl
    Registrar SIDN: JA
    KvK nummer: 24269577

    Ook als de Whois server onbereikbaar bij een "is" query zal je script retourneren dat de domeinnaam geregistreerd is.
    DreamHost.nl Web hosting - cPanel hosting om bij weg te dromen.



  8. #8
    whois IS voor .nl domeinen PHP script
    geregistreerd gebruiker
    240 Berichten
    Ingeschreven
    19/12/08

    Locatie
    Hofstade(Aalst)

    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    0 Berichten zijn liked


    Registrar SIDN: nee
    KvK nummer: nvt
    Ondernemingsnummer: 0476930984

    DNS.be heeft een aparte server om zulke checks uit te voeren, deze geeft geen whois info terug, alleen wat de status is van de domeinnaam. Misschien moet je eens kijken of SIDN niets gelijkaardig heeft?

  9. #9
    whois IS voor .nl domeinen PHP script
    Web hosting diensten
    4.705 Berichten
    Ingeschreven
    09/02/04

    Locatie
    Rotterdam

    Post Thanks / Like
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    110 Berichten zijn liked


    Bedrijf: DreamHost.nl Web hosting
    Functie: Managing Director
    URL: www.dreamhost.nl
    Registrar SIDN: JA
    KvK nummer: 24269577

    Die is er momenteel niet. D.m.v. 'is' krijg je indd. de status terug, maar bij een fout in de verbinding of als de whois server niet beschikbaar is zal TS dit niet kunnen zien momenteel.
    DreamHost.nl Web hosting - cPanel hosting om bij weg te dromen.

Labels voor dit Bericht

Webhostingtalk.nl

Contact

  • Rokin 113-115
  • 1012 KP, Amsterdam
  • Nederland
  • Contact
© Copyright 2001-2021 Webhostingtalk.nl.
Web Statistics