Yesterday I started writing a script for checking domain names. But now I have a problem with the fgets-function.
Today the whois server of .to domains (whois.tonic.to) didn't seem to work corectly. The connect-procedure was no problem, it worked fine, but when I tried to read out the data, the script timed out.
Obviously the file pointer was not at eof, but fgets couldn't read out the data, so the script timed out.
Here's my source:
<?
$socket = fsockopen("whois.tonic.to", 43, &$errno, &$errstr, 10);
if (!$socket) die("Could not connect");
fputs($fp, "test.to\t\n");
while(!feof($fp)) $output .= fgets($fp, 128);
fclose($fp);
echo "<pre>$output</pre>";
?>
Does someone has a solution for this problem?? Thanx in advance!
Greetz,
Daniel