|
Posted by C. (http://symcbean.blogspot.com/) on 10/26/07 13:02
On 26 Oct, 09:47, AnrDaemon <anrdae...@freemail.ru> wrote:
> Greetings, Kevin Blount.
> In reply to Your message dated Friday, October 26, 2007, 08:56:24,
>
> KB> I'm trying to create the forum favorite dynamic sig image, that's
> KB> realy PHP script. I've had moderate success with .php files but when I
> KB> change the extension to .png I'm prompted to download the file, rather
> KB> than it rendering.
>
> KB> My understanding is that this is not supposed to happen, and that by
> KB> adding an.htaccess file I can force .png files to be compiled/parsed/
> KB> whatevered by PHP. In my .htaccess file I have:
>
> KB> AddType application/x-httpd-php .png
>
> KB> Any advice?
>
> KB> I'm using heliohost.org as my host, and they basically pointed me to
> KB> create the above file (as the first reply to my recent support query).
> KB> Googling this I'm not seeing that I'm doing anything wrong.. so what
> KB> gives?
>
> Can't say if AddType allowed in .htaccess or not.
> Your best bet is to use header(); function and leave extension .php as is.
> If You are running rented virtual server, You have little to no ability to
> control document types on server.
>
> Other way is to ask Your hosting provider if it is possible to use filters
> SAPI instead of default Apache handler SAPI. But that only available if PHP
> running as Apache module AFAIK.
>
> --
> Sincerely Yours, AnrDaemon <anrdae...@freemail.ru>
The AddType setting determines how Apache interprets filenames and
what handler to use for them - not what gets sent to the client.
1) you don't need to have all PNG files parsed by the webserver - just
point your IMG SRC to the PHP script, and...
2) set the content type for the browser to use in a header(...) call
in your PHP
C.
[Back to original message]
|