Page 1 of 1
Picture Including
Posted: Thu Nov 16, 2006 10:53 pm
by tecktalkcm0391
Could somone refresh my memory can you just go like this:
Code: Select all
include("\home\images\picture1.jpg");
or do you have to do something eles to show a picture from non internet visiable folder?
Posted: Thu Nov 16, 2006 10:59 pm
by John Cartwright
You would have a php script supply the image using file_get_contents() and readfile(), and include it via
Code: Select all
<img src="http://domain.com/image.php?id=image4">
Posted: Thu Nov 16, 2006 11:41 pm
by brendandonhue
Also you need to send a Content-type with header() before your include().
Posted: Fri Nov 17, 2006 12:55 pm
by feyd
Content-type and content-length are both needed. Do not ever use include() for binary files unless you know EXACTLY what you're doing. Any PHP code contained within will be run.
Posted: Fri Nov 17, 2006 5:58 pm
by tecktalkcm0391
How could I take a picture file than and make it displayed from a non internet visiable folder?
Posted: Fri Nov 17, 2006 9:58 pm
by tecktalkcm0391
Wow Jcart I totally skipped over you post. It helped a lot THANKS!