vafen

Apának :D

Aug 8th, 2011
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.93 KB | None | 0 0
  1. Ellenőrző
  2.  
  3. <?php
  4. function checkDomain($domain,$server,$findText){
  5. // Open a socket connection to the whois server
  6. $con = fsockopen($server, 43);
  7. if (!$con) return false;
  8.  
  9. // Send the requested domain name
  10. fputs($con, $domain."\r\n");
  11.  
  12. // Read and store the server response
  13. $response = ' :';
  14. while(!feof($con)) {
  15. $response .= fgets($con,128);
  16. }
  17.  
  18. //Close the connection
  19. fclose($con);
  20.  
  21. // Check the response stream whether the domain is available
  22. if (strpos($response, $findText)){
  23. return true;
  24. }
  25. else {
  26. return false;
  27. }
  28. }
  29. function showDomainResult($domain,$server,$findText){
  30. if (checkDomain($domain,$server,$findText)){
  31. echo "<tr><td><input type='radio' name='radiobtn' value='$domain' checked/>".$domain; echo "&nbsp;<font color='#00FF00'>Szabad</color></td></tr>";
  32.  
  33. }
  34. else echo "<tr><td>$domain</td><td><font color='#FF0000'>Foglalt</color></td></tr>";
  35. }
  36. if (isset($_POST['megrendbtn'])) {
  37. $radiobutton = (isset($_POST['radiobtn'])) ? $_POST['radiobtn'] : '';
  38.  
  39. echo("
  40. <script language='javascript'>
  41. location.href='viewpage.php?page_id=1&parameter=$radiobutton'
  42. </script>
  43. ");
  44. }
  45.  
  46. ?>
  47.  
  48. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
  49. <html>
  50. <head>
  51. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  52. </head>
  53. <body>
  54. <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="domain">
  55. Domain name:
  56. <table width="155" height="368">
  57. <tr>
  58. <td>&nbsp;</td>
  59. <td><input name="domainname" type="text" /></td></tr>
  60. <tr>
  61. <td width="30">&nbsp;</td>
  62. <td><input type="checkbox" name="hu" checked/>.hu</td></tr>
  63. <tr>
  64. <td>&nbsp;</td>
  65. <td><input type="checkbox" name="eu" checked/>.eu</td></tr>
  66. <tr>
  67. <td>&nbsp;</td>
  68. <td><input type="checkbox" name="com" checked/>.com</td></tr>
  69. <tr>
  70. <td>&nbsp;</td>
  71. <td><input type="checkbox" name="net" checked/>.net</td></tr>
  72. <tr>
  73. <td>&nbsp;</td>
  74. <td><input type="checkbox" name="org" checked/>.org</td></tr>
  75. <tr>
  76. <td>&nbsp;</td>
  77. <td><input type="checkbox" name="info" checked/>.info</td></tr>
  78. <tr>
  79. <td>&nbsp;</td>
  80. <td><input type="checkbox" name="biz" checked/>.biz</td></tr>
  81. <tr>
  82. <td>&nbsp;</td>
  83. <td><input type="checkbox" name="name" checked/>.name</td></tr>
  84. <tr>
  85. <td>&nbsp;</td>
  86. <td><input type="checkbox" name="cc" checked/>.cc</td></tr>
  87. <tr>
  88. <td>&nbsp;</td>
  89. <td><input type="checkbox" name="tv" checked/>.tv</td></tr>
  90. <tr>
  91. <td>&nbsp;</td>
  92. <td><input type="checkbox" name="de" checked/>.de</td></tr>
  93. <tr>
  94. <td>&nbsp;</td>
  95. <td><input type="checkbox" name="at" checked/>.at</td></tr>
  96. <tr>
  97. <td>&nbsp;</td>
  98. <td><input type="submit" name="submitBtn" value="Check domain"/></td></tr>
  99. </table>
  100. <?php
  101. // The form was submitted
  102. if (isset($_POST['submitBtn'])){
  103. $domainbase = (isset($_POST['domainname'])) ? $_POST['domainname'] : '';
  104. $d_hu = (isset($_POST['hu'])) ? 'hu' : '';
  105. $d_eu = (isset($_POST['eu'])) ? 'eu' : '';
  106. $d_com = (isset($_POST['com'])) ? 'com' : '';
  107. $d_net = (isset($_POST['net'])) ? 'net' : '';
  108. $d_org = (isset($_POST['org'])) ? 'org' : '';
  109. $d_info = (isset($_POST['info'])) ? 'info' : '';
  110. $d_biz = (isset($_POST['biz'])) ? 'biz' : '';
  111. $d_name = (isset($_POST['name'])) ? 'name' : '';
  112. $d_cc = (isset($_POST['cc'])) ? 'cc' : '';
  113. $d_tv = (isset($_POST['tv'])) ? 'tv' : '';
  114. $d_de = (isset($_POST['de'])) ? 'de' : '';
  115. $d_at = (isset($_POST['at'])) ? 'at' : '';
  116.  
  117. // Check domains only if the base name is big enough
  118. if (strlen($domainbase)>2){
  119. echo '<table width="100%">';
  120. if ($d_hu != '')
  121. showDomainResult($domainbase.".hu",'whois.nic.hu', 'No match');
  122. echo '</table>';
  123. }
  124. if (strlen($domainbase)>2){
  125. echo '<table width="100%">';
  126. if ($d_eu != '')
  127. showDomainResult($domainbase.".eu",'whois.eu','AVAILABLE'); // jó majd később
  128. echo '</table>';
  129. }
  130. if (strlen($domainbase)>2){
  131. echo '<table width="100%">';
  132. if ($d_com != '')
  133. showDomainResult($domainbase.".com",'whois.crsnic.net','No match for');
  134. echo '</table>';
  135. }
  136. if (strlen($domainbase)>2){
  137. echo '<table width="100%">';
  138. if ($d_net != '')
  139. showDomainResult($domainbase.".net",'whois.crsnic.net','No match for');
  140. echo '</table>';
  141. }
  142. if (strlen($domainbase)>2){
  143. echo '<table width="100%">';
  144. if ($d_org != '')
  145. showDomainResult($domainbase.".org",'whois.publicinterestregistry.net','NOT FOUND');
  146. echo '</table>';
  147. }
  148. if (strlen($domainbase)>2){
  149. echo '<table width="100%">';
  150. if ($d_info != '')
  151. showDomainResult($domainbase.".info",'whois.afilias.net','NOT FOUND');
  152. echo '</table>';
  153. }
  154. if (strlen($domainbase)>2){
  155. echo '<table width="100%">';
  156. if ($d_biz != '')
  157. showDomainResult($domainbase.".biz",'whois.nic.biz','Not found');
  158. echo '</table>';
  159. }
  160. if (strlen($domainbase)>2){
  161. echo '<table width="100%">';
  162. if ($d_name != '')
  163. showDomainResult($domainbase.".name",'whois.nic.name','No match');
  164. echo '</table>';
  165. }
  166. if (strlen($domainbase)>2){
  167. echo '<table width="100%">';
  168. if ($d_cc != '')
  169. showDomainResult($domainbase.".cc",'whois.nic.cc','No match');
  170. echo '</table>';
  171. }
  172. if (strlen($domainbase)>2){
  173. echo '<table width="100%">';
  174. if ($d_tv != '')
  175. showDomainResult($domainbase.".tv",'whois.nic.tv','No match for');
  176. echo '</table>';
  177. }
  178. if (strlen($domainbase)>2){
  179. echo '<table width="100%">';
  180. if ($d_de != '')
  181. showDomainResult($domainbase.".de",'whois.denic.de','free');
  182. echo '</table>';
  183. }
  184. if (strlen($domainbase)>2){
  185. echo '<table width="100%">';
  186. if ($d_at != '')
  187. showDomainResult($domainbase.".at",'whois.nic.at', 'nothing found');
  188. echo ' </table>';
  189. if ($domainbase != '')
  190. { print '<input name="megrendbtn" type="submit" value="Megrendelem"/>';
  191.  
  192. }
  193. else {
  194. }
  195. }
  196. }
  197. ?></td>
  198. </tr>
  199. </form>
  200. </body>
  201.  
  202.  
  203. Fogadó
  204.  
  205. <?php
  206. $megrendelt = $_GET['parameter'];
  207. echo $megrendelt;
  208. ?>
Advertisement
Add Comment
Please, Sign In to add comment