0 ) header("Content-disposition: inline; filename=\"".$row['filename']."\""); else header("Content-disposition: inline; filename=\"Photo-".$id.".jpg\""); echo $row['photo']; mysql_free_result($res); }else { // No photo found, show error picture header("Content-type: image/png"); $im = ImageCreate(120, 50); $background_color = ImageColorAllocate($im, 104, 103, 222); $text_color = ImageColorAllocate($im, 242, 186, 47); ImageString($im, 2, 5, 5, "Photo ".$id." (".$size.")", $text_color); ImageString($im, 2, 5, 20, "not found", $text_color); ImagePNG($im); ImageDestroy($im); } ?>