I have a script that loads an image url from a link, and it is supposed to check if the image exists or not. If it does, then show the image, if not then display an error and log it to a file.
I can never get file_exists to actually work. I have tried making $File be a relative URL, an absolute URL, but it ALWAYS shows the error message.
if (file_exists("$File"))
{
echo "
<br clear=\"all\"><p><img src=\"$File\" border=\"0\" alt=\"Enlarged Version\"><p>";
}
else
{
echo "<p>The image does not appear to be where it should be.
<br />This error has been logged for the site administrator.";
$file_name="$SC_URL/Logs/error.txt";
$file_pointer = fopen($file_name, "a");
fwrite($file_pointer, "Image missing from $File\n");
fclose($file_pointer);
}
any ideas?