For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > January 2008 > Including a GD-generated Image in an HTML Page?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Including a GD-generated Image in an HTML Page?
ashore

2008-01-04, 10:00 pm

Guys, I gave an OK image being generated and i need to include in a
page/script, and I wonder what's a good way to do that. (The data
generating the image changes dynamically, so it makes no sense to save
the image.)

I'd rather not save the image as a temporary file (which wd then be
called via html's <img src='foo'> ). Right now I see my doing it via
an Iframe, with the target being the image generator script. But
there's gotta be better ways, so, ... ?

Thanks all,

AS
Michael Fesser

2008-01-04, 10:00 pm

..oO(ashore)

>Guys, I gave an OK image being generated and i need to include in a
>page/script, and I wonder what's a good way to do that. (The data
>generating the image changes dynamically, so it makes no sense to save
>the image.)
>
>I'd rather not save the image as a temporary file (which wd then be
>called via html's <img src='foo'> ). Right now I see my doing it via
>an Iframe, with the target being the image generator script. But
>there's gotta be better ways, so, ... ?


Call the image generator script from withing your 'img' element:

<img src="theScript.php" alt="...">

The script just has to deliver the image data with a correct
Content-Type header.

Micha
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com