Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Pobieranie informacji o IP (whois), takie jak: country, person, route....
Daimos
post
Post #1





Grupa: Zarejestrowani
Postów: 1 319
Pomógł: 118
Dołączył: 26.11.2003
Skąd: Lublin

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


Kod
212.182.63.102 = w3cache.lublin.pl
inetnum:      212.182.63.0 - 212.182.63.255
netname:      PL-LUB-MAN-1
descr:        LUBMAN, Provider Local Registry
descr:        Internal Usage (backbone & servers)
country:      PL
admin-c:      AR1187-RIPE
tech-c:       AR1187-RIPE
tech-c:       AU229-RIPE
status:       ASSIGNED PA
remarks:      renumbered from 192.147.37.0
mnt-by:       PL-LUBMAN-MNT
mnt-lower:    PL-LUBMAN-MNT
source:       RIPE

person:       Andrzej Resztak
address:      ZIO UMCS
address:      Pl. Marii Curie-Sklodowskiej 1
address:      20-031 Lublin
address:      POLAND
phone:        +48 81 537 2017
fax-no:       +48 81 537 2027
e-mail:       Andrzej.Resztak@man.lublin.pl
nic-hdl:      AR1187-RIPE
mnt-by:       PL-LUBMAN-MNT
source:       RIPE

person:       Artur Urbanowicz
address:      LubMAN UMCS
address:      Pl. Marii Curie-Sklodowskiej 1
address:      20-031 Lublin
address:      Poland
phone:        +48 81 5376278
fax-no:       +48 81 5376295
e-mail:       Artur.Urbanowicz@man.lublin.pl
nic-hdl:      AU229-RIPE
source:       RIPE


route:        212.182.0.0/18
descr:        academic part of Lublin MAN, Poland
origin:       AS12324
remarks:      removed cross-nfy:    AR1187-RIPE
mnt-by:       PL-LUBMAN-MNT
source:       RIPE

no wlasnie, jak takie cos uzyskac (IMG:http://forum.php.pl/style_emoticons/default/snitch.gif) ?

Ten post edytował buffalo soldier 7.05.2005, 22:29:33
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Daimos
post
Post #2





Grupa: Zarejestrowani
Postów: 1 319
Pomógł: 118
Dołączył: 26.11.2003
Skąd: Lublin

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


  1. <?php
  2. $target = $_SERVER[&#092;"REMOTE_ADDR\"];
  3. $server = &#092;"whois.ripe.net\";
  4. print &#092;"<b>Info dla:</b> \" . $target . \"<br />\";
  5. $target = gethostbyname($target);
  6. if (! $sock = fsockopen($server, 43, $num, $error, 20))
  7. {
  8. unset($sock);
  9. $msg .= &#092;"Timed-out connecting to $server (port 43)\";
  10. }else{
  11. fputs($sock, &#092;"$targetn\");
  12. while (!feof($sock))
  13. {
  14. $buffer .= fgets($sock, 10240);
  15. }
  16. fclose($sock);
  17. }
  18. $buffer = explode(&#092;"n\", $buffer);
  19. foreach($buffer as $line)
  20. {
  21. $line = preg_replace('/s+/', ' ', $line);
  22. $line = explode(&#092;":\", $line);
  23. $line[1] = trim($line[1]);
  24. if($line[0] == &#092;"inetnum\" || $line[0] == \"netname\" || $line[0] == \"descr\" || $line[0] == \"country\")
  25. {
  26. if(empty($data[$line[0]]))
  27. {
  28. $data[$line[0]] = $line[1];
  29. }else{
  30. $data[$line[0]] .= &#092;" \" . $line[1];
  31. }
  32. }
  33. if($line[0] == &#092;"country\")
  34. {
  35. break;
  36. }
  37. }
  38. print_r($data);
  39. ?>

tylko co tu zmodyfikowac zeby mi wyswietlalo WSZYSTKIE mozliwe informacje
troche to za ciezki kod jak dlamnie i niewiem (IMG:http://forum.php.pl/style_emoticons/default/sad.gif)
i jak zrobic zeby nie wyswietlalo tego w postaci: array.......
tylko normalnie:
country: xxx
netname: asdasdasd

ps. skrypt tellme nie dziala dobrze, wyswietla wiele, ale wlasnie whois nie dziala :/

Ten post edytował buffalo soldier 7.05.2005, 22:54:39
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 3.10.2025 - 14:41