getimagesize() and file_exists() problems
Posted: Tue Mar 07, 2006 11:10 pm
I have a strange problem with some code for some images. I create the image path using both static data and a field from the database eg:
I then use the result of this to populate a img field, the problem being when I run a check on $img to see if it exists, it always returns false (ie. doesn't exist) even when it's clearly obvious that it does seeing as though the image displays correctly. I've tried clearing cache etc, but it doesn't seem to work. A similar problem happens with getimagesize() on $img, nothing is returned like it can't find the image, but again it does exist. I noticed if I use relative path and not absolute then things work? any reason for this?
Code: Select all
$img = '/path/to/file/'.$db_field;