I am trying to establish that an image exists, to print it, and when not exist to print out that it does not exist. The code I am using is:
[php]$qr_file = $qr_path . $mls . ‘_LC.png’;
if (file_exists($qr_file)) {
print “”;
} else {
print “The file $qr_file, does not exist!!”;
} // endif[/php]
the $qr_file, when printed out via the “does not exist” under the } else { when copied and pasted into the address bar of my browser, displays the image fine. However, the “file_exists” command does not find the file.
I am currently testing this on my LAMP (XAMPP), before putting it online:
The path to the folder containing the image is: http://localhost/_LC/qr_codes/
The $mls is the real estate mls #
The balance of the file name is : _LC.png
When it prints out via the “does not exist” option, the complete file path is:
http://localhost/_LC/qr_codes/LA1234567_LC.png
Again, this url when pasting it into the browser, brings up the image fine. Any thoughts on why the (file_exists($qr_file)) is not detecting that this filename exists? :’(