php - How to display photo from non-public folder? -
i have built website in way actual database files positioned follows
root/ root/httpdocs <- public folder root/databasefolder/actual_files_here/some_photo.jpg
how can implement php can view/load photo databasefolder , echo tag. tried "../databasefolder/"
in tag, doesn't work (of course doesn't), since it's hidden folder.
i tried base64 works in other browsers, not internet explorer, due silly kb limit.
in html:
<img src="image.php?image=some_photo.jpg" />
and php script echoes image.
header('content-type: image/jpeg'); echo imagejpeg('root/databasefolder/actual_files_here/' . $_get['image']);
you can use parameter "image" load whatever image need folder.
Comments
Post a Comment