Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> mam taki skrpt więc co z nim mam zrobić ???? żeby mi działał
marcinsaint
post 5.04.2002, 14:18:30
Post #1





Grupa: Zarejestrowani
Postów: 9
Pomógł: 0
Dołączył: 4.04.2002
Skąd: Rybnik

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


sad.gif <?php

/***************************************************************
* *
* 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>
Go to the top of the page
+Quote Post
em1X
post 8.04.2002, 19:44:20
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 biggrin.gif
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: 5.08.2025 - 18:46