Results 1 to 5 of 5
Thread: prob - fsocketopen
-
12-29-2008, 09:06 PM #1WHT Addict
- Join Date
- Jun 2003
- Posts
- 125
hi, small prob?
ok - i have a PHP WHOIS and it works on other hosts - it always worked,
i currently have an alt. account as a reseller with directadmin.
fsocketopendoesn't work, why
any clue
i tried that function to retrieve a webpage and it worked but, for whois, nothing, (the whois server is not down, etc.)
thx.
-
12-29-2008, 10:26 PM #2Web Hosting Master
- Join Date
- Apr 2005
- Posts
- 1,767
I think you mean fsockopen()
If you are using that, what timeout settings are you using, show some code..
-
12-29-2008, 10:42 PM #3WHT Addict
- Join Date
- Jun 2003
- Posts
- 125
ok
here - i tested on another server - ok!
http://eliot.comze.com/s.htm
(enter a .com to test)
the code below does not work on my host, direct admin acct. thx.
<pre>
<?php
function WhoIs($DomainName)
{
// Open a socket to geektools.com, one of the whois servers
$Socket = fsockopen("whois.crsnic.net", 43, $ErrorNum, $ErrorStr) or die("$errno: $errstr");
fputs($Socket, $DomainName."\n");
// Receive data from the whois server and put into a string
while(!feof($Socket))
{
$WhoIsString .= fgets($Socket, 2048);
}
// Close the stream and return the string
fclose($Socket);
return $WhoIsString;
}
if (isset($_GET['inputText']))
{
echo $_GET['inputText'];
$who=WhoIs( $_GET['inputText']);
}
echo "<pre>".WhoIs( $_GET['inputText']);
?>
-
12-29-2008, 11:25 PM #4Web Hosting Master
- Join Date
- Apr 2005
- Posts
- 1,767
This might be the hosts firewall. Ask them to open up port 43 outbound for your account to that hostname, they should let you do that.
-
12-29-2008, 11:27 PM #5WHT Addict
- Join Date
- Jun 2003
- Posts
- 125
ok, thats sounds like a solution. i emailed them, ok, happy holidays.