login  Naam:   Wachtwoord: 
Registreer je!
 Scripts:

Scripts > PHP > Handige scripts > Domeincheck (WHOIS)

Domeincheck (WHOIS)

Auteur: WumTol - 12 maart 2006 - 12:36 - Gekeurd door: nemesiskoen - Hits: 21964 - Aantal punten: 3.33 (3 stemmen)



Zeer handige domeincheck met de mogelijkheid extensies toe te voegen in de $whois-array:

$whois['ext'] = array(server, poort, domein, vrijbericht);

Code:
  1. <?php
  2. ?>
  3. <html>
  4.  
  5. <head>
  6. <title>wTol. ~ Whois</title>
  7. <style>
  8. body, td, input {
  9. font-family: verdana;
  10. font-size: 11px;
  11. }
  12.  
  13. form {
  14. margin: 0px;
  15. }
  16.  
  17. a {
  18. color: black;
  19. text-decoration: none;
  20. }
  21. </style>
  22. </head>
  23.  
  24. <body>
  25.  
  26. <?php
  27. $whois = array();
  28. $whois['nl'] = array("whois.domain-registry.nl", 43, "{domein}.nl", "is free");
  29. $whois['be'] = array("whois.dns.be", 43, "{domein}", "FREE");
  30. $whois['com'] = array("whois.nsiregistry.net", 43, "{domein}.com", "No match for");
  31. $whois['net'] = array("whois.nsiregistry.net", 43, "{domein}.net", "No match for");
  32. $whois['org'] = array("whois.publicinterestregistry.net", 43, "{domein}.org", "NOT FOUND");
  33. $whois['info'] = array("whois.afilias.info", 43, "{domein}.info", "NOT FOUND");
  34. $whois['biz'] = array("whois.biz", 43, "{domein}.biz", "Not found:");
  35. $whois['nu'] = array("whois.nic.nu", 43, "{domein}.nu", "NO MATCH");
  36.  
  37. function whois($whois)
  38. {
  39. list ($server, $poort, $domein, $vrij) = $whois;
  40. $domein = str_replace("{domein}", $_GET['domein'], $domein);
  41.  
  42. $fp = fsockopen($server, $poort);
  43.  
  44. if($fp)
  45. {
  46. fputs($fp, $domein."\r\n");
  47.  
  48. while(!feof($fp))
  49. {
  50. $data .= fread($fp, 1000);
  51. }
  52.  
  53. fclose($fp);
  54. }
  55. else
  56. {
  57. $data = "error";
  58. }
  59.  
  60. return $data;
  61. }
  62.  
  63. if ($_REQUEST['submit'])
  64. {
  65. header("location:?domein=".$_POST['domein']);
  66. }
  67. elseif (!empty($_GET['domein']))
  68. {
  69. if (!empty($_GET['ext']))
  70. {
  71. echo "<pre>".whois($whois[$_GET['ext']])."</pre>".
  72. "<br>".
  73. "&raquo; <a href=\"?domein=".$_GET['domein']."\">Terug</a>";
  74. }
  75. else
  76. {
  77. echo "<table>".
  78. "<tr>".
  79. "<td><u>Domeincheck:</u></td>".
  80. "<td>&nbsp;</td>".
  81. "</tr>";
  82.  
  83. foreach ($whois as $ext => $value)
  84. {
  85. list ($server, $poort, $domein, $vrij) = $value;
  86.  
  87. $data = whois($value);
  88.  
  89. if (!ereg($vrij, $data))
  90. {
  91. $status = "<a href=\"?domein=".$_GET['domein']."&ext=".$ext."\"><font color=\"red\">bezet</font></a>";
  92. }
  93. elseif ($data == "error")
  94. {
  95. $status = "<font color=\"red\">error</font>";
  96. }
  97. else
  98. {
  99. $status = "<font color=\"darkgreen\">vrij</font>";
  100. }
  101.  
  102. echo "<tr>".
  103. "<td>".$_GET['domein'].".".$ext."</td>".
  104. "<td align=\"right\">".$status."</td>".
  105. "</tr>";
  106. }
  107.  
  108. echo "</table>".
  109. "<br>".
  110. "&raquo; <a href=\"whois.php\">Terug</a>";
  111. }
  112. }
  113. else
  114. {
  115. ?>
  116. <form method="post">
  117. <table>
  118. <tr>
  119. <td>Domeinnaam zonder extensie:</td>
  120. <td><input type="text" name="domein"></td>
  121. </tr>
  122. <tr>
  123. <td>&nbsp;</td>
  124. <td><input type="submit" name="submit" value="Controleer!"></td>
  125. </tr>
  126. </table>
  127. </form>
  128. <?php
  129. }
  130. ?>
  131.  
  132. </body>
  133.  
  134. </html>
Download code! Download code (.txt)

 Stemmen
Niet ingelogd.

 Reacties
Post een reactie
Lees de reacties (14)
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.034s