PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
tecktalkcm0391
DevNet Resident
Posts: 1030 Joined: Fri May 26, 2006 9:25 am
Location: Florida
Post
by tecktalkcm0391 » Thu Nov 16, 2006 10:53 pm
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?
John Cartwright
Site Admin
Posts: 11470 Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:
Post
by John Cartwright » Thu Nov 16, 2006 10:59 pm
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">
brendandonhue
Forum Commoner
Posts: 71 Joined: Mon Sep 25, 2006 3:21 pm
Post
by brendandonhue » Thu Nov 16, 2006 11:41 pm
Also you need to send a Content-type with header() before your include().
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Fri Nov 17, 2006 12:55 pm
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.
tecktalkcm0391
DevNet Resident
Posts: 1030 Joined: Fri May 26, 2006 9:25 am
Location: Florida
Post
by tecktalkcm0391 » Fri Nov 17, 2006 5:58 pm
How could I take a picture file than and make it displayed from a non internet visiable folder?
tecktalkcm0391
DevNet Resident
Posts: 1030 Joined: Fri May 26, 2006 9:25 am
Location: Florida
Post
by tecktalkcm0391 » Fri Nov 17, 2006 9:58 pm
Wow Jcart I totally skipped over you post. It helped a lot THANKS!