Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> whois
zulus
post 5.07.2003, 20:13:36
Post #1





Grupa: Zarejestrowani
Postów: 225
Pomógł: 18
Dołączył: 30.06.2003
Skąd: Wrocław

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


Jak na podstawie adresu ip lub hosta w php zadać pytanie whois
Go to the top of the page
+Quote Post
Mnichasso
post 6.07.2003, 10:17:28
Post #2





Grupa: Zarejestrowani
Postów: 97
Pomógł: 13
Dołączył: 26.06.2003
Skąd: Piekary Śląskie

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


A na co jest te pytanie ?


--------------------
This is only game
Go to the top of the page
+Quote Post
wassago
post 6.07.2003, 12:45:17
Post #3





Grupa: Przyjaciele php.pl
Postów: 701
Pomógł: 0
Dołączył: 26.06.2002
Skąd: Londyn

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


[php:1:b2c6754e93]<?php

function myWhois($query, $server)
{
$toRet = "";
$fp = fsockopen($server, 43, &$errno, &$errstr, 30);
if(!$fp)
return $errstr . " (" . $errno . ")";
else
{
fputs($fp,$query . "n");
while(!feof($fp)) $toRet .= fgets($fp,128) . "<br>n";

return $toRet;
}
fclose($fp);
}
?>[/php:1:b2c6754e93]

np.
[php:1:b2c6754e93]<?php

if(!$_POST) $_POST = $HTTP_POST_VARS;

?>
<html>
<body>
<form method="post" action="<?php echo $PHP_SELF; ?>">
Domain: <input type="txt" name="domain" size="30" value="<?php echo $_POST["domain"] ? $_POST["domain"] : ""; ?>"><br>
Whois server: <input type="txt" size="30" name="whoisServer" value="<?php echo $_POST["whoisServer"] ? $_POST["whoisServer"] : "whois.networksolutions.com"; ?>">
<input type="submit" value="Query domain">
<?php

function myWhois($query, $server)
{
$toRet = "";
$fp = fsockopen($server, 43, &$errno, &$errstr, 30);
if(!$fp)
return $errstr . " (" . $errno . ")";
else
{
fputs($fp,$query . "n");
while(!feof($fp)) $toRet .= fgets($fp,128) . "<br>n";

return $toRet;
}
fclose($fp);
}

if($_POST["domain"])
{
echo "<br>n<hr>n";

echo myWhois($_POST["domain"], (($_POST["whoisServer"])? $_POST["whoisServer"] : "whois.networksolutions.com"));
}
?>
</form>
<script>
function window.onload(){ document.forms[0].domain.focus(); }
</script>
</body>
</html>
[/php:1:b2c6754e93]

@Mnichasso "whois" - to jest pytanie :wink:

przyklad z zend.com


--------------------
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: 15.08.2025 - 04:00