Images not showing correctly
I have a block of code that inserts an image from my database, if the image is not found it inserts a default image instead. My dbImages folder is up one level from my results page. When I run it it only shows the default image even though I think the path is correct. When I look at the generated code (firebug) it shows the path to the default image. Any help is appreciated.
<!-- Script for checking that the image is correct--><?php if(file_exists(str_replace(".JPG",".jpg",$row_WADAinventory["image"]))) { ?><img class="WADAResultThumb" border="0" src="../dbImages/<?php echo $row_WADAinventory["image"]; ?>" alt="<?php echo $row_WADAinventory["model"]; ?>" /><?php } else { ?><img class="WADAResultThumb" src="../images/default.jpg" border="0" alt="<?php echo $row_WADAinventory["model"]; ?>" /><?php } ?></a>
All the best
Tom