Reply to Re: [PHP] how to display GD graphic in web page

Your name:

Reply:


Posted by Jasper Bryant-Greene on 10/25/05 04:45

On Mon, 2005-10-24 at 20:14 -0400, Chris wrote:
> I don't understand what is going on with a simple example I created to
> understand how GD graphics are presented in a web page.
[[snip]]
> However if I replace:
> <img src=graphic.php>
>
> with
>
> <img src=<?php
> $image = imagecreatefrompng("my_graphic.png");
> imagepng($image);
> ?> >
>
> my_graphic.png is no longer displayed and the web page gets filled with
> random characters.
>
> Why is this happening or what am I missing.

You're not missing anything. That is exactly the expected behaviour. You
can call graphic.php with GET variables if you need to pass information
on, but you can't put images inline like that except for with data:
URIs.

data: URIs are currently only supported by Gecko browsers (Mozilla,
Firefox, etc) and maybe Safari or Opera (not sure about the latter two).

Do a search for "data: URI RFC" or similar to find out about them.

--
Jasper Bryant-Greene
General Manager
Album Limited

e: jasper@album.co.nz
w: http://www.album.co.nz/
p: 0800 4 ALBUM (0800 425 286) or +64 21 232 3303
a: PO Box 579, Christchurch 8015, New Zealand

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация