Sockets
Please try this code and give me results.
It will connect to whois.ripe.net and get whois information about given domain. My connection is slow so i have to wait for month to see results.
<html>
<head>
<title>Who is</title>
</head>
<body>
<center>
<form action=fsock.php method=post>
<input type="text" name=ip size=35>
<input type="submit" value="Submit">
</form>
</center>
<?
if (isset($_POST['ip']) && $_POST['ip']!="")
{
echo "<br>IP = ".$ip = gethostbyname($_POST['ip']); //shows ip address.
$sock = fsockopen("whois.ripe.net",43,$errno,$errstr);
if (!$sock)
{
echo $errno.'('.$errstr.')';
return;
}
else
{
fputs($sock,$ip."<br>");
while(!feof($sock))
{
echo str_replace(":",": &n bsp;",
fgets($sock,128))."<br>";
}
}
fclose($sock);
}
?>
</body>
</html>
|