Re: Including GD inside HTML code
| From: | Jim Lucas | Date: | Fri, 02 Nov 2007 15:39:38 +0000 |
| Subject: | Re: Including GD inside HTML code | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-263986@lists.php.net to get a copy of this message | ||
David Giragosian wrote:
On 11/1/07, Instruct ICC <instructicc@hotmail.com> wrote:It does not "prevent" other HTML output, but the browser will not read it as HTML, it will think that it is binary data in the format of the picture data instead. -- Jim Lucas "Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them." Twelfth Night, Act II, Scene V by William ShakespeareBut the header, say __header("Content-type: image/png");__ would go at the top of generate_image.php, to stay with the example above, no? Doesn't direct output from GD function calls, necessarily using a header call of the correct type, prevent any other html output on that page? DavidAlberto García Gómez wrote:and numbers but no image.I trying to include some image generate for a function that use GD. eg.: function myfunct(){[MY_CODE]} but when I call the function it generate me a lot of symbols, letterspage and place it using this tag.WHAT CAN I DO? PS.: I actually usgin a iframe to create the iomage in another .php"Carlos Marx" de Matanzas.Este correo ha sido enviado desde el Politécnico de Informáticaimage in the HTML."La gran batalla se librará en el campo de las ideas"Sounds like you are trying to output the actual file content of theYou should have a separate script generate the img and link to it withyour HTML<img src="generate_image.php?img=someImage" /> Then in the script generate_image.php you create the image and pass itback at that point. Depending on what is in your myfunct(), you may also need to set a header to let the browser know what type of content you are outputting.