Re: how to display GD graphic in web page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx
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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux