Autor Zpráva
IdemeNaHavaj
Profil
Zdravím, stiahol som si PHPWhois script:
http://www.phpwhois.org/

A chcem cez to zisťovať či je doména volná alebo nie. Je možné ju zaregistrovať alebo nie.
Problém je, že to pri každej doméne vracia iný obsah.

Tak napríklad pri .com:

Array
(
    [regrinfo] => Array
        (
            [registered] => no
            [domain] => Array
                (
                    [name] => dfshdhdsfijdshfaj.com
                )

        )

    [regyinfo] => Array
        (
            [servers] => Array
                (
                    [0] => Array
                        (
                            [server] => com.whois-servers.net
                            [args] => domain =dfshdhdsfijdshfaj.com
                            [port] => 43
                        )

                )

            [type] => domain
        )

    [rawdata] => Array
        (
            [0] => 
            [1] => Whois Server Version 2.0
            [2] => 
            [3] => Domain names in the .com and .net domains can now be registered
            [4] => with many different competing registrars. Go to http://www.internic.net
            [5] => for detailed information.
            [6] => 
            [7] => No match for domain "DFSHDHDSFIJDSHFAJ.COM".
            [8] => >>> Last update of whois database: Mon, 20 May 2013 17:06:01 UTC <<<
            [9] => 
            [10] => NOTICE: The expiration date displayed in this record is the date the 
            [11] => registrar's sponsorship of the domain name registration in the registry is 
            [12] => currently set to expire. This date does not necessarily reflect the expiration 
            [13] => date of the domain name registrant's agreement with the sponsoring 
            [14] => registrar.  Users may consult the sponsoring registrar's Whois database to 
            [15] => view the registrar's reported date of expiration for this registration.
            [16] => 
            [17] => TERMS OF USE: You are not authorized to access or query our Whois 
            [18] => database through the use of electronic processes that are high-volume and 
            [19] => automated except as reasonably necessary to register domain names or 
            [20] => modify existing registrations; the Data in VeriSign Global Registry 
            [21] => Services' ("VeriSign") Whois database is provided by VeriSign for 
            [22] => information purposes only, and to assist persons in obtaining information 
            [23] => about or related to a domain name registration record. VeriSign does not 
            [24] => guarantee its accuracy. By submitting a Whois query, you agree to abide 
            [25] => by the following terms of use: You agree that you may use this Data only 
            [26] => for lawful purposes and that under no circumstances will you use this Data 
            [27] => to: (1) allow, enable, or otherwise support the transmission of mass 
            [28] => unsolicited, commercial advertising or solicitations via e-mail, telephone, 
            [29] => or facsimile; or (2) enable high volume, automated, electronic processes 
            [30] => that apply to VeriSign (or its computer systems). The compilation, 
            [31] => repackaging, dissemination or other use of this Data is expressly 
            [32] => prohibited without the prior written consent of VeriSign. You agree not to 
            [33] => use electronic processes that are automated and high-volume to access or 
            [34] => query the Whois database except as reasonably necessary to register 
            [35] => domain names or modify existing registrations. VeriSign reserves the right 
            [36] => to restrict your access to the Whois database in its sole discretion to ensure 
            [37] => operational stability.  VeriSign may restrict or terminate your access to the 
            [38] => Whois database for failure to abide by these terms of use. VeriSign 
            [39] => reserves the right to modify these terms at any time. 
            [40] => 
            [41] => The Registry database contains ONLY .COM, .NET, .EDU domains and
            [42] => Registrars.
        )

)

a pri .sk

Array
(
    [rawdata] => Array
        (
            [0] => %
            [1] => % whois.sk-nic.sk - whois server for TLD .sk
            [2] => %
            [3] => 
            [4] => 
            [5] => Not found.
            [6] => 
        )

    [regyinfo] => Array
        (
            [servers] => Array
                (
                    [0] => Array
                        (
                            [server] => sk.whois-servers.net
                            [args] => dfshdhdsfijdshfaj.sk
                            [port] => 43
                        )

                )

            [type] => domain
        )

    [regrinfo] => Array
        (
            [domain] => Array
                (
                    [name] => dfshdhdsfijdshfaj.sk
                )

            [registered] => unknown
        )

)

Ako vytvoriť podmienku,
if()
ak je doménu možné zaregistrovať alebo nie?
MyShare
Profil
Nazdar ja používam toto
Index.php
<?php
error_reporting(0);
set_time_limit(0);
ob_start();

$ext = array(
  '.sk' => array('whois.sk-nic.sk','NOT FOUND'),
  '.org' => array('whois.pir.org','NOT FOUND'),
  '.com' => array('whois.crsnic.net','No match for'),
  '.net' => array('whois.crsnic.net','No match for'),
  '.biz' => array('whois.biz','Not found'),
  '.mobi' => array('whois.dotmobiregistry.net', 'NOT FOUND'),
  '.tv' => array('whois.nic.tv', 'No match for'),
  '.in' => array('whois.inregistry.net', 'NOT FOUND'),
  '.info' => array('whois.afilias.net','NOT FOUND'),
  '.co.uk' => array('whois.nic.uk','No match'),
  '.co.ug' => array('wawa.eahd.or.ug','No entries found'),
  '.or.ug' => array('wawa.eahd.or.ug','No entries found'),
  '.nl' => array('whois.domain-registry.nl','not a registered domain'),
  '.ro' => array('whois.rotld.ro','No entries found for the selected'),
  '.com.au' => array('whois.ausregistry.net.au','No data Found'),
  '.ca' => array('whois.cira.ca', 'AVAIL'),
  '.org.uk' => array('whois.nic.uk','No match'),
  '.name' => array('whois.nic.name','No match'),
  '.us' => array('whois.nic.us','Not Found'),
  '.ac.ug' => array('wawa.eahd.or.ug','No entries found'),
  '.ne.ug' => array('wawa.eahd.or.ug','No entries found'),
  '.sc.ug' => array('wawa.eahd.or.ug','No entries found'),
  '.ws' => array('whois.website.ws','No Match'),
  '.be' => array('whois.ripe.net','No entries'),
  '.com.cn' => array('whois.cnnic.cn','no matching record'),
  '.net.cn' => array('whois.cnnic.cn','no matching record'),
  '.org.cn' => array('whois.cnnic.cn','no matching record'),
  '.no' => array('whois.norid.no','no matches'),
  '.se' => array('whois.nic-se.se','No data found'),
  '.nu' => array('whois.nic.nu','NO MATCH for'),
  '.com.tw' => array('whois.twnic.net','No such Domain Name'),
  '.net.tw' => array('whois.twnic.net','No such Domain Name'),
  '.org.tw' => array('whois.twnic.net','No such Domain Name'),
  '.cc' => array('whois.nic.cc','No match'),
  '.nl' => array('whois.domain-registry.nl','is free'),
  '.pl' => array('whois.dns.pl','No information about'),
  '.pt' => array('whois.dns.pt','No match')
);

?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html" charset="UTF-8">
<title>Overenie dostupnosti domény</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="wrap">
 <h1>Overte si dostupnosť domény...</h1>
 <div class="wrap-input">
 <form action="" method="post" name="frmsearchposition" id="frmsearchposition">
  <input name="domains" id="domains">
  <button type="submit">Overiť Dostupnosť</button>
 </form>
 </div>
 <div class='status'>
      <?php
     function return_status($domain, $status)
    {
      global $extension;
      $domain = trim($domain);

      $weight = ($status == 'Voľná') ? 'bold' : 'bold';
      $color = ($status == 'Voľná') ? 'green' : 'red';
      $decoration = ($status == 'Neplatná' && $extension == 'org') ? 'underline' : 'none';
     ?>
   <?php
       echo "<span style=\"font-weight:$weight;color:$color;
      text-decoration:$decoration\">Doména $domain je $status!</span>";
    }
    ?>
    <?php
    if(strlen($_POST['domains']) > 0)
    {
      $domains = explode("\n", $_POST['domains']);
      echo (isset($_POST['save'])) ?
        'Vyhľadávam, prosím čakajte...<br /><br />' : null;

      foreach($domains as $domain)
      {
        unset($buffer);
        preg_match('@^(+)@i]http://www\.|http://|www\.)?([^/]+)@i', $domain, $matches);
        $domain = $matches[2];

        $tld = explode('.', $domain, 2);
        $extension = strtolower(trim($tld[1]));

        if(strlen($domain) > 0 &&
          array_key_exists('.' . $extension, $ext))
        {
          $server = $ext['.' .$extension][0];

          $sock = fsockopen($server, 43) or
            die('Chyba pri spojení servera:' . $server);
          fputs($sock, "$domain\r\n");

         while( !feof($sock) )
         {
           $buffer .= fgets($sock,128);
         }

         if(eregi($ext['.' . $extension][1], $buffer)) {
           return_status($domain, 'Voľná');
         }
         else
         {
           return_status($domain, 'Obsadená');
         }
        }
        else
        {
          if(strlen($domain) > 0) { return_status($domain, 'Neplatná'); }
        }

        ob_flush();
        flush();
        sleep(0.1);
      }
    }
    ?>
 </div>
 </div>

</body>
</html>

A ešte css :)
* {
    margin: 0; padding: 0;
}
body, html {
    margin: 0;
    padding: 0;
}
h1 { font-size: 22px; text-align: center; }
#wrap {
    width: 500px;
    height: 250px;
    margin: 0 auto;
    margin-top: 150px;
}
.wrap-input {
    width: 450px;
    height: 110px;
    margin: 15px 0 0 25px;
}
input {
    width: 440px;
    height: 45px;
    margin: 5px 0 0 5px;
    font-size: 24px;
}
button {
    width: 440px;
    height: 45px;
    margin: 5px 0 0 5px;
    font-size: 24px;
    cursor: pointer;
}
.status {
    width: 100%;
    height: 30px;
    margin: 15px 0 0 0;
    text-align: center;
}
span {
    font-size: 16px;
    font-family: Tahoma;
    font-variant: normal;
    font-style: normal;
    font-weight: normal;
}

Aby som nezabudol asi aktuálny whois kde mi fungujú všetky prehľadávania domén Whois Zoznam
IdemeNaHavaj
Profil
MyShare:
Ten skript ktorý si napísal mám aj ja ale ten tvoj mi nefunguje.
A .cz .eu domény tam chýbajú - práve tie s ktorými mám inak problémy. :(

Pri .eu doménach mám problémy zistiť aké slová to má hladať, žiadne NOT FOUND ani nič podobné to nehlási.
Pri .cz doménach mi to často hlási že sa nedá pripojiť na server (whois.nic.cz alebo cz.whois-servers.net)
Nováčik
Profil *
IdemeNaHavaj: prosím Ťa a nedal by si sem ten tvoj script, ja sa snažím uŽ týždeň niečo podobné zbúchať ale stále mi nič nefunguje, a ani ten čo je tu hore nejde.

Vaše odpověď


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm: