Output images in document

images php coding issues or problems here.

Moderators: macek, egami, gesf

jpgalea

Output images in document

Postby jpgalea » Sun Mar 13, 2005 8:05 am

I am inserting images using the blob command into my mysql database.
I then want to output other data (text) together with the image.
The idea is that of having organisation details together with a logo of each organisation. However I cant manage to display the images (only the binary data is displayed as a series of characters). I know I have to use headers to display the images however that would block the text I have to display, therefore im stumped as to what is the solution of this problem is. Any help would be very much appreciated :help:

User avatar
ruturajv
php-forum Super User
php-forum Super User
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India
Contact:

Postby ruturajv » Sun Mar 13, 2005 7:48 pm

you NEED a different script that outputs a different Content-Type
as in your case "image/jpeg|gif|png"

jpgalea

Postby jpgalea » Mon Mar 14, 2005 12:30 am

Ok but would that display the text as well? My script outputs images correctly but the problem is that it is designed for outputting just images. Therefore when text is inserted the whole thing doesnt work. Sorry if im missing something but I cant figure it out yet

User avatar
swirlee
Moderator
Moderator
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

Postby swirlee » Mon Mar 14, 2005 8:07 am

A single script cannot return both text and binary (e.g. image) data. If you want a script that outputs an image, it must do only that. If you want a script that outputs text, it must do only that. You can't have both at once. If you want both, you need two scripts.


Return to “PHP coding => Images”

Who is online

Users browsing this forum: No registered users and 1 guest