For some reason this PHP code below will not work, I can not figure it out.
It is very strange, file_exists does not seem to see that the image does exist, I have c
file_exists does only work on the local file system.
So try this if you’re using localhost:
$thumb_name = 'images/userphoto/1/2/2/59874a886a0356abc1_thumb9.jpg'; if (file_exists($_SERVER['DOCUMENT_ROOT'].$thumb_name)) { $img_name = SITE_PATH2.$thumb_name; } else { $img_name = $noimg; }