[pmwiki-users] php that produces image data

Joachim Durchholz jo at durchholz.org
Sat Jul 2 05:13:43 CDT 2005


Chris Cox wrote:
 > This may be more of an Html question,

Indeed :-)

> I have a php function that produced raw image data... for example, png
> data.  Is there a way to embed that into something... even using
> markup??  I know about <img src="blah.png" .... anyway to display
> a data stream??

You can use the data: URL scheme; this embeds the data directly within 
the HTML. However, the size of the encoded image (including header) is 
limited to 1024 characters, so you can't put large things into it.

The other way to do that is to wrap the PHP function as a CGI script in 
the pub/ directory. You'd then have
   http://your.server/path/to/pmwiki/pub/script.php?parameter=value
The PHP can then pick the parameter value from $_REQUEST['parameter']. 
(Note that you are responsible for doing any access checks from within 
the script if you want to do it that way.)

Regards,
Jo



More information about the pmwiki-users mailing list