Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> PHP Odpytanie WHOIS
rollon
post 6.02.2010, 09:33:25
Post #1





Grupa: Zarejestrowani
Postów: 24
Pomógł: 0
Dołączył: 14.03.2007

Ostrzeżenie: (0%)
-----


Witam,

ściągnąłem z sieci skrypt, który ma za zadanie sprawdzenie czy podana domena jest zajęta czy nie.

  1.  
  2. function checkDomainReg($domain, $server="whois.crsnic.net") {
  3.  
  4. $lineNumber = 8;
  5. // open a socket connection to a whois server
  6. $fp = fsockopen ($server, 43, &$errnr, &$errstr) or die("$errno: $errstr");
  7. fputs($fp, "$domain\n");
  8. while (!feof($fp)) {
  9. //return each line of stout and place it in $serverReturn
  10. $serverReturn = fgets($fp, 2048);
  11. $x++;
  12. if ($x == $lineNumber) {
  13. $line = $serverReturn;
  14. }
  15. }
  16. fclose($fp);
  17. //tokenize the string so we can find the No
  18. $token = strtok("$line"," ");
  19. if ($token == 'No') {
  20. $result = 0;
  21. } else {
  22. $result = 1;
  23. }
  24. return $result;
  25. }
  26.  


Tylko przy podaniu domeny wyświetla mi błąd:

  1. Warning: fsockopen() [function.fsockopen]: unable to connect to whois.crsnic.net:43 (Operation not permitted) in ... on line 31



Próbowałem zmieniać serwer Whois ale to nie dało rezultatu. głównie chodzi mi o przeszukiwanie domen niemieckich.

Z góry dziękuje za pomoc.
Go to the top of the page
+Quote Post
XianN
post 6.02.2010, 17:53:35
Post #2





Grupa: Zarejestrowani
Postów: 57
Pomógł: 9
Dołączył: 12.11.2005
Skąd: ze wnowu?!

Ostrzeżenie: (0%)
-----


Bo problem nie jest w serwerze WHOIS tylko Twoim, na ktorym odpalasz skrypt. To tam nie masz uprawnien do otworzenia socketa.


--------------------
Yes, sex is always the answer, it's never a question
Cos' the answers yes, oh the answers yes.
Not just a suggestion, if you ask the question
Then its always yes, yeah!
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 26.06.2025 - 19:43