Re: Trouble with AddType application/x-httpd-php .png



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Kevin Blount wrote:
I'm trying to create the forum favorite dynamic sig image, that's
realy PHP script. I've had moderate success with .php files but when I
change the extension to .png I'm prompted to download the file, rather
than it rendering.

My understanding is that this is not supposed to happen, and that by
adding an.htaccess file I can force .png files to be compiled/parsed/
whatevered by PHP. In my .htaccess file I have:

AddType application/x-httpd-php .png

Any advice?

I'm using heliohost.org as my host, and they basically pointed me to
create the above file (as the first reply to my recent support query).
Googling this I'm not seeing that I'm doing anything wrong.. so what
gives?


I agree with the second poster - I don't think you can change the types
with .htaccess. You could try using mod_rewrite to direct everything from
, say, "/image-12345.png" to "image.php?id=12345". I'm not great with
regular expressions but I'm sure someone else can help you out with that.

- --
Brendan Gillatt
brendan {at} brendangillatt {dot} co {dot} uk
http://www.brendangillatt.co.uk
PGP Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xBACD7433
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32)

iD8DBQFHIf8FkA9dCbrNdDMRAj/RAJ4sTogymJHcE9q+u8qNVKohnCWwIgCg2pJk
kA8IGylIajuEVPq2oB5JQSE=
=Brkz
-----END PGP SIGNATURE-----
.



Relevant Pages

  • Re: overwriting characters
    ... I would likely use the GD extension for php. ... background transparent for a png or gif and trim the now transparent ... png I created, the file size is only 352 bits. ...
    (alt.html)
  • Re: Problem with http File Transfer
    ... I have a web app that creates an image of a graph (as a png), ... The link calls the following php script: ... I've tried comparing the file saved on the server with the file saved to ...
    (comp.lang.php)
  • RE: [PHP] treu type fonts
    ... I tried the png like you suggested and the same thing happens. ... Subject: [PHP] treu type fonts ... PHP General Mailing List ...
    (php.general)
  • pgnuplot output on PHP page
    ... I trying to use gnuplot-win32 to plot data on a page using PHP. ... like to not save the png image on the server, ... But when i use the readfilecommand, the png is spit out the page. ...
    (comp.graphics.apps.gnuplot)
  • Re: Help Needed: Upgrade Fedora 4 / Apache 2 to PHP 5.2.x from 5.0.4
    ... there some other way to add the missing mysql stuff to the new PHP, ... should I keep looking for PHP 5.2.x binaries for Fedora 4, ... Brendan Gillatt ... brendan brendangillatt {dot} co uk ...
    (comp.lang.php)