domain search

mute

Registered
Трябвами скрипт които да проверява дали даден домейн е регестриран
някакви идеи ?
 
mute каза:
Трябвами скрипт които да проверява дали даден домейн е регестриран
някакви идеи ?

http://web-tourist.net/login/login/view.php?st=1301


има още един на същия автор и още не съм го изтрил.
Погледни и него но той твърдеше, че този е по добър вариант
 
за жалост това търси само за някои домеини а на мен ми трябва и за други
 
mute каза:
за жалост това търси само за някои домеини а на мен ми трябва и за други

в документа microWhois.php
Код:
 <?php
function checkDomain($domain,$server,$findText){
// Open a socket connection to the whois server
$con = fsockopen($server, 43);
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
if (strpos($response, $findText)){
return true;
}
else {
return false;
}
}

function showDomainResult($domain,$server,$findText){
if (checkDomain($domain,$server,$findText)){
echo "<tr><td>$domain</td><td>AVAILABLE</td></tr>";
}
else echo "<tr><td>$domain</td><td>TAKEN</td></tr>";
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>MicroWhois domain checker</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="main">
<div id="caption">DOMAIN LOOKUP</div>
<div id="icon"> </div>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="domain" id="domain">
Domain name:
<table>
<tr><td><input class="text" name="domainname" type="text" size="36"/></td></tr>
<tr>
<td>
<input type="checkbox" name="all" checked />All
<input type="checkbox" name="com"/>.com
<input type="checkbox" name="net"/>.net
<input type="checkbox" name="org"/>.org
<input type="checkbox" name="info"/>.info
</td></tr>
<tr><td align="center"><br/><input class="text" type="submit" name="submitBtn" value="Check domain"/></td></tr>
</table>
</form>
<?php
if (isset($_POST['submitBtn'])){
$domainbase = (isset($_POST['domainname'])) ? $_POST['domainname'] : '';
$d_all = (isset($_POST['all'])) ? 'all' : '';
$d_com = (isset($_POST['com'])) ? 'com' : '';
$d_net = (isset($_POST['net'])) ? 'net' : '';
$d_org = (isset($_POST['org'])) ? 'org' : '';
$d_info = (isset($_POST['info'])) ? 'info' : '';

// Check domains only if the base name is big enough
if (strlen($domainbase)>2){
?>
<div id="caption">RESULT</div>
<div id="icon2"> </div>
<div id="result">
<table width="100%">
<?php
if (($d_com != '') || ($d_all != '') ) showDomainResult($domainbase.".com",'whois.crsnic.net','No match for');
if (($d_net != '') || ($d_all != '') ) showDomainResult($domainbase.".net",'whois.crsnic.net','No match for');
if (($d_org != '') || ($d_all != '') ) showDomainResult($domainbase.".org",'whois.publicinterestregistry.net','NOT FOUND');
if (($d_info != '') || ($d_all != '') ) showDomainResult($domainbase.".info",'whois.afilias.net','NOT FOUND');
?>
</table>
</div>
<?php
}
}
?>
<div id="source">Micro Whois 1.1</div>
</div>
</body>

намираш редовете:
<input type="checkbox" name="all" checked />All
<input type="checkbox" name="com"/>.com
<input type="checkbox" name="net"/>.net
<input type="checkbox" name="org"/>.org
<input type="checkbox" name="info"/>.info


и добавяш какво още да търси

после в тези редове добавяш същото което си добавил и в горните
<?php
if (isset($_POST['submitBtn'])){
$domainbase = (isset($_POST['domainname'])) ? $_POST['domainname'] : '';
$d_all = (isset($_POST['all'])) ? 'all' : '';
$d_com = (isset($_POST['com'])) ? 'com' : '';
$d_net = (isset($_POST['net'])) ? 'net' : '';
$d_org = (isset($_POST['org'])) ? 'org' : '';
$d_info = (isset($_POST['info'])) ? 'info' : '';


и в тези редове добавяш същото което си добавил и в горните
<?php
if (($d_com != '') || ($d_all != '') ) showDomainResult($domainbase.".com",'whois.crsnic.net','No match for');
if (($d_net != '') || ($d_all != '') ) showDomainResult($domainbase.".net",'whois.crsnic.net','No match for');
if (($d_org != '') || ($d_all != '') ) showDomainResult($domainbase.".org",'whois.publicinterestregistry.net','NOT FOUND');
if (($d_info != '') || ($d_all != '') ) showDomainResult($domainbase.".info",'whois.afilias.net','NOT FOUND');
?>


и това е цялата работа!!!Готов си!!!!
 
Имам това


Код:
<html>
    <head>
     <title>domaincheck</title>
    </head>
    <body>
    
    <table border="0" cellpadding="0" cellspacing="5" align="center">
     <tr>
      <td>
       <form name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
        <b>Domain (ohne www.):</b>
        <input type="text" name="dom">
        <select name="endung">
         <option value=".de">.de</option>
         <option value=".com">.com</option>
         <option value=".net">.net</option>
         <option value=".org">.org</option>
         <option value=".info">.info</option>
         <option value=".biz">.biz</option>
         <option value=".at">.at</option>
         <option value=".ch">.ch</option>
         <option value=".li">.li</option>
         <option value=".co.uk">.co.uk</option>
         <option value=".tv">.tv</option>
         <option value=".cc">.cc</option>
         <option value=".dk">.dk</option>
         <option value=".it">.it</option>
         <option value=".ws">.ws</option>
         </select>
        <input type="submit" name="Submit" value="Check">
       </form>
    <?php
    if ($_POST['dom'])
    {
     $dom = $_POST['dom'].$_POST['endung'];
     $whoisresult = lookup($dom);
     print '<pre>'.$whoisresult.'</pre>';
    }
    
    function get_whois_server($domain)
    {
     $whoisservers = array(array('de','whois.denic.de'),
     array('com','rs.internic.net'),
     array('net','rs.internic.net'),
     array('org','whois.networksolutions.com'),
     array('info','whois.afilias.net'),
     array('biz','whois.biz'),
     array('at','whois.nic.at'),
     array('ch','whois.nic.ch'),
     array('li','whois.nic.ch'),
     array('co.uk','whois.nic.uk'),
     array('tv','whois.<a href = "http://www.tv" target = "_blank">www.tv</a>'),
     array('cc','whois.enicregistrar.com'),
     array('dk','whois.dk-hostmaster.dk'),
     array('it','whois.nic.it'),
     array('ws','whois.worldsite.ws'));
     $whocnt = count($whoisservers);
     for ($x = 0;$x<$whocnt;$x++)
     {
      $artld = $whoisservers[$x][0];
      $tldlen = intval(0 - strlen($artld));
      if (substr($domain, $tldlen) == $artld) $whosrv = $whoisservers[$x][1];
     }
     return $whosrv;
    }
    
    function lookup($dom)
    {
     $lusrv = get_whois_server($dom);
     if (!$lusrv) return '';
     $fp = fsockopen($lusrv,43);
     fputs($fp,$dom."\r\n");
     $string = '';
     while(!feof($fp))
     {
      $string .= fgets($fp,128);
     }
     fclose($fp);
     $reg = "/Whois Server: (.*?)\n/i";
     preg_match_all($reg, $string, $matches);
     $secondtry = $matches[1][0];
     if ($secondtry)
     {
      $fp = fsockopen($secondtry,43);
      fputs($fp, $dom."\r\n");
      $string = '';
      while(!feof($fp))
      {
       $string .= fgets($fp,128);
      }
      fclose($fp);
     }
     if(ereg('(No match|No entries found|NOT FOUND|Not found)',$string))
     {
      echo '<b>Die suche nach '.$dom.' hat folgendes Ergebnis geliefert:</</b>';
     }else{
      echo '<b>Die suche nach '.$dom.' hat folgendes Ergebnis geliefert:</b>';
      $whois = $string;
      return $whois;
     }
    }
    ?>
        </td>
      </tr>
    </table>
    
    </body>
    </html>
 

Back
Горе