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