One of my friends is stuck with a hosting provider who is still on PHP 3.0.5
The following code results in an error. I am interested in using fsockopen with the timeout. But the parameter count is apparently wrong for 3.0.5 (no mention of this on the PHP documentation)
Warning: Wrong parameter count for fsockopen() in /www/htdocs/sathyasaivictims/hari-admin/test.php on line 5
()
<?php
$fp = fsockopen (\"www.php.net\", 80, $errno, $errstr, 30);
if (!$fp) {
echo \"$errstr ($errno)<br>\n\";
} else {
fputs ($fp, \"GET / HTTP/1.0\r\nHost: www.php.net\r\n\r\n\");
while (!feof($fp)) {
echo fgets ($fp,128);
}
fclose ($fp);
}
?>