On Mon, 11 Feb 2002, Matt Moreton wrote:
> I have a script that outputs an image.  Using the gd library.  But the
...
> the image.  Is it possible somehow to request the file as a .jpg?
> www.host.com/displayimage.php

Assuming you're using Apache, you can use a rewrite rule (with
mod_rewrite).  http://httpd.apache.org/docs/mod/mod_rewrite.html

Turn the rewrite engine on, then specify a rewrite rule which tells apache
to execute your script when a certain file is requested.

Using the file names you specified, add this to your httpd.conf (or your
.htaccess):

RewriteEngine on
RewriteRule ^/displayimage.jpg$ /displayimage.php [L]

You can then just use /displayimage.jpg as an image src, then when a
visitor's browser requests it, apache will execute & return
/displayimage.php instead, and the visitor will never know.

        ~Chris                           /"\
                                         \ /     September 11, 2001
                                          X      We Are All New Yorkers
                                         / \     rm -rf /bin/laden


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

Reply via email to