Well, I restarted the server and it worked now... but then I have this other problem. When I fopen an URL and the site doesn't exist, it still says that the site exists. For a live sample, please visit http://pikographics.com/fopen.php and the code is below:
<form name="form1" method="post" action="<? print $_SERVER['PHP_SELF']; ?>">
<input name="site" type="text" id="site" value="http://" size="35">
<input type="submit" name="Submit" value="Check">
</form>
<hr>
<?php
if($REQUEST_METHOD=='POST') {
$handle = fopen($site, "rb");
$contents = '';
while (!feof($handle)) {
$contents .= fread($handle, 1024);
}
if($contents != '') { print "Site found"; }
if($contents == '') { print "Site not found"; }
fclose($handle);
}
?>