![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 9 Pomógł: 0 Dołączył: 4.04.2002 Skąd: Rybnik Ostrzeżenie: (0%) ![]() ![]() |
![]() /*************************************************************** * * * whois.php - odpytuje serwer whois.ripe.net * * 03-06-2001 19:30 * * autor: Krzysztof Walkowicz <wela@zst.edu.pl> * * inspiracja z www.zend.com * * * ***************************************************************/ class whois { var $server; var $port; var $data; // ustawia nazwe serwera whois function set_server($server) { $this->server = $server; } // ustawia numer portu serwera whois function set_port($port) { $this->port = $port; } // wysyla zapytanie do serwera whois function query($adress) { $fp = fsockopen($this->server, $this->port); if (!$fp) { $this->data = 0; return FALSE; } else { fputs($fp, "$adressn"); $this->data = fread($fp, 16384); fclose($fp); return TRUE; } } // zwraca pola descr z odpowiedzi serwera whois function get_info() { $lines = split("n", $this->data); while (list($key, $value) = each($lines)) if (ereg("descr: +(.*)", $value, $match)) $info .= "$match[1]n"; return $info; } } // tworzy nowy obiekt whois, ustawia parametry, wysyla zapytanie i podaje odpowiedz $whois = new whois; $whois->set_server("whois.ripe.net"); $whois->set_port(43); if($whois->query($q)) if($whois->get_info()) $info = $whois->get_info(); else $info = "Brak danychn"; ?> <html> <head></head> <body bgcolor=white> <br> <br> <table align=center width=400 border=1 bordercolor=#d0d0d0> <tr bgcolor=#d0d0d0> <td> <big><?php echo $q;?></big> </td> </tr> <tr> <td> <pre><?php echo $info;?></pre> </td> </tr> </table> </body> </html> |
|
|
![]()
Post
#2
|
|
![]() Grupa: Zarejestrowani Postów: 984 Pomógł: 41 Dołączył: 16.03.2002 Skąd: Płock Ostrzeżenie: (0%) ![]() ![]() |
.. nadac zmiennej $q odpowiedni adres IP.. chyba logiczne
![]() |
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 5.08.2025 - 18:46 |