Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more

Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Web Programming > PHP Development
User Name
Password

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 06-10-2007, 04:50 AM   #1 (permalink)
weber
Junior Member
 
weber's Avatar
 
Join Date: Dec 2006
Posts: 40
Default 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(":",":&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;",
fgets($sock,128))."<br>";
}
}
fclose($sock);
}
?>
</body>
</html>
weber is offline   Reply With Quote
Sponsored Links
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Points Per Thread View: 1.00
Points Per Thread: 11.00
Points Per Reply: 5.00



» Sponsors

» Links

» Affiliates
Web Hosting
Marketing Find
Merchant Select
SiteMap Builder
Host Compare
Dedicated Servers

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 04:57 AM.



LinkBacks Enabled by vBSEO 3.0.0 RC8
Webmaster Forums