Check is file exists, not just the URL

iciejctjj

New Member
I've seen tutorials over the internet for this, but I cannot get it to work.I've got this in a while loop, but it shouldn't matter:\[code\]while($row = mysql_fetch_object($result)){$image_url = $deviceimg.($row->Image);if(!file_exists($image_url)){}else {$image_url = 'images/android.png';}\[/code\]Basically, im my database, all the rows called Image are populated, but only some of them have an actual file. What im trying to do is check to see if the image file actually exists on the server, if it doesn't use a default image (images/android.png)No matter that I do, it will either replace ALL images with the default, or it will just use the URL in the database, regardless of if the file actually exists.
 
Back
Top