is there something wrong with this code?
$tempFile = $path.$r['aStock'].".jpg;
if (file_exists($tempFile)) {
// this is populated from my database
$imgFile = $path.$r['aStock'].".jpg";
} else {
$imgFile = $path."default.jpg";
}
echo "<img src='$imgFile'>"
the $tempFile is the path to the file obviously. It is correct, I have tested the path to make sure it is right;
This function seems to print the default.jpg even for the files that do exist;