I'm using the following code to check if a file exists on the server. If not
it should do one thing but if it does exist it should do something else.
This seems to be working except when the file doesn't exist - It echos the
message to say the file doesn't exist but also outputs the following error:
Can anyone help please?
THE ERROR
_______________ _______________ _______________ _______
Warning: fopen("images/villas/extra/259.jpg", "r") - No such file or
directory in /home/zionhill/public_html/proof/villaparade/villa.php on line
652
The error is then followed by "Could Not Open File" so I know it is
partially working
THE CODE
---------------------------------------------------------------------
if (!$file=fopen(" images/villas/extra/259.jpg","r")){
echo ("Could Not Open File");
} else {
echo ("The file exists")
}
it should do one thing but if it does exist it should do something else.
This seems to be working except when the file doesn't exist - It echos the
message to say the file doesn't exist but also outputs the following error:
Can anyone help please?
THE ERROR
_______________ _______________ _______________ _______
Warning: fopen("images/villas/extra/259.jpg", "r") - No such file or
directory in /home/zionhill/public_html/proof/villaparade/villa.php on line
652
The error is then followed by "Could Not Open File" so I know it is
partially working
THE CODE
---------------------------------------------------------------------
if (!$file=fopen(" images/villas/extra/259.jpg","r")){
echo ("Could Not Open File");
} else {
echo ("The file exists")
}
Comment