I have the following 2 scripts based upon user input from this board. The scripts basically fetch the contents of a remote site (URL). The scripts work fine for a domain (www.phpbuilder.com) but the control hangs when used with a domain link (www.phpbuilder.com/forum) or a URL which does not exist. Any clues why is this happening?
<?
$url = "www.phpbuilder.com/forum";
echo strip_tags(join('',file($url)));
?>
AND
<?
$url = "www.phpbuilder.com/forum";
$fp = fsockopen ($url, 80, &$errno, &$errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
fputs ($fp, "GET / HTTP/1.0\r\n\r\n");
while (!feof($fp)) {
echo fgets ($fp,128);
}
fclose ($fp);
}
?>