fork download
  1. <?php
  2. /* как сделать, чтобы дохуя доменов проверяло? */
  3. $list=array('yoba.com','yoba.org','yoba.net','yoba.cn');
  4.  
  5. function whoisit($domain,$zone){
  6. $resp = get_whois($domain); # получаем whois-запись
  7.  
  8. preg_match("!^\s*Whois Server:\s+([\w\.]+)\b!im", $resp, $matches); # извлекаем адрес whois-сервера
  9. $server = $matches[1];
  10.  
  11. preg_match("!^\s*Expiration Date:\s+([\w\-]+)\b!im", $resp, $matches); # извлекаем дату истечения срока домена
  12. $expiry = $matches[1];
  13.  
  14. $exptime = strtotime($expiry); # вычисляем количество дней до окончания срока
  15. $expdays = round(($exptime - time()) / 84600);
  16. $expiry = date("d/m/Y", $exptime);
  17.  
  18. print $whois_doman = "$domain &#160; ";
  19. print $whois_server = "$server &#160; ";
  20. print $whois_expires = "$expiry &#160; ";
  21. print $whois_days ="days: $expdays";
  22.  
  23. $array = array (
  24. "biz" => "whois.neulevel.biz",
  25. "com" => "whois.internic.net",
  26. "us" => "whois.nic.us",
  27. "coop" => "whois.nic.coop",
  28. "info" => "whois.nic.info",
  29. "name" => "whois.nic.name",
  30. "net" => "whois.internic.net",
  31. "gov" => "whois.nic.gov",
  32. "edu" => "whois.internic.net",
  33. "mil" => "rs.internic.net",
  34. "int" => "whois.iana.org",
  35. "ac" => "whois.nic.ac",
  36. "ae" => "whois.uaenic.ae",
  37. "at" => "whois.ripe.net",
  38. "au" => "whois.aunic.net",
  39. "be" => "whois.dns.be",
  40. "bg" => "whois.ripe.net",
  41. "br" => "whois.registro.br",
  42. "bz" => "whois.belizenic.bz",
  43. "ca" => "whois.cira.ca",
  44. "cc" => "whois.nic.cc",
  45. "ch" => "whois.nic.ch",
  46. "cl" => "whois.nic.cl",
  47. "cn" => "whois.cnnic.net.cn",
  48. "cz" => "whois.nic.cz",
  49. "de" => "whois.nic.de",
  50. "fr" => "whois.nic.fr",
  51. "hu" => "whois.nic.hu",
  52. "ie" => "whois.domainregistry.ie",
  53. "il" => "whois.isoc.org.il",
  54. "in" => "whois.ncst.ernet.in",
  55. "ir" => "whois.nic.ir",
  56. "mc" => "whois.ripe.net",
  57. "to" => "whois.tonic.to",
  58. "tv" => "whois.tv",
  59. "ru" => "whois.ripn.net",
  60. "org" => "whois.pir.org",
  61. "aero" => "whois.information.aero",
  62. "nl" => "whois.domain-registry.nl"
  63. );
  64.  
  65.  
  66. /* тута шота сломалось */
  67. foreach ($array as $key=>$value) {
  68. if ($key==$zone) $server=$value;
  69. }
  70.  
  71. function get_whois ($domain, $server) {
  72. if (trim($domain) <> ""); //что делает эта хуйня?
  73. }
  74. /* тута шота сломалось */
  75.  
  76. $domain = trim($domain);
  77. $fp = fsockopen($server, 43, $errno, $errstr, 30);
  78. if (!$fp) {
  79. $response = $errstr.'('.$errno.')';
  80. } else {
  81. $response = "";
  82. fputs($fp, "$domain\r\n");
  83. while (!feof($fp))
  84. $response .= fread($fp,128);
  85. fclose ($fp);
  86. }
  87. //код ужасен, я бы тебе за него руки оторвал, мудило
  88.  
  89. /* как захуячить if else "домен свободен" */
  90. //примерно так
  91. if (@$sock = fsockopen ($server, 80, $errno, $errstr, 0.2)) {
  92. echo "Сосни хуйца";
  93. fclose ($sock);
  94. } else {
  95. echo "Всё круто";
  96. }
  97.  
  98. return $response; //как ты уже понял, нахуй не надо это говно
  99. }
  100.  
  101. for ($i=0;$i<4;$i++){
  102. $domain=$list[$i];
  103. $zone=preg_match(/нутыпонел/);
  104. whoisit($domain,$zone);
  105. }
  106. ?>
Runtime error #stdin #stdout #stderr 0.01s 20592KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Parse error:  syntax error, unexpected '/', expecting ')' in /home/LlGgGv/prog.php on line 103