I'm writing some code to find out whether a file exists but I need to know if there is a command out there that can get rid of the PHP error messages. This is my code please tell me what to add to it:
<body>
<?
$file = fopen($url,"r");
if(!$file) {
print("<P>error</P>");
exit;
}
else {
//will be adding my own code in later
}
fclose ($file);
print "<img src=$url>"; //just to see the image
?>
</body>
This is the error I get if the thing does not exist:
Warning: php_network_getaddresses: gethostbyname failed in D:\PHPWEB\XITAMI\webpages\findsize.php on line 4
Warning: fopen("http://dragonlizzard.dfxwebs.com/images/glen_bay.jpg", "r") - No such file or directory in D:\PHPWEB\XITAMI\webpages\findsize.php on line 4
error
This is what I want it to say:
error
Thanks in advance,
-Victor