Specifying the src attribute on an IMG which is not on the server..

R

Rithish

Hello people...

I am unsure if javascript has got to do anything with my problem.. In
fact I am even unsure of a solution to my problem.

What I want to achieve is to pick the image data from the database
rather as a static file on the server. I have a PHP file which
supplies me with the image data from the database.

Effectively, I would want something like

<IMG src='http://myserver.com/GetImage.php?strImageId=img_id_1'/>

GetImage.php is a file which would serve me with the image data from
the database; depending on the 'strImageId' variable.

The above snippet outputs a pile of binary data.... Are there headers
to be inserted?? I really dont know... I am stumped.. I really
appreciate your help, folks..

Regards,
Rithish.
 
M

Martin Honnen

Rithish said:
I am unsure if javascript has got to do anything with my problem.. In
fact I am even unsure of a solution to my problem.

What I want to achieve is to pick the image data from the database
rather as a static file on the server. I have a PHP file which
supplies me with the image data from the database.

Effectively, I would want something like

<IMG src='http://myserver.com/GetImage.php?strImageId=img_id_1'/>

GetImage.php is a file which would serve me with the image data from
the database; depending on the 'strImageId' variable.

The above snippet outputs a pile of binary data.... Are there headers
to be inserted??

Well, it is a PHP question, make sure your GetImage.php tells the client
that it sends an image, e.g. for a GIF image
header('Content-Type: image/gif');
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top