Re: Fooling the client into thinking php script is .jpg

From: Date: Mon, 11 Feb 2002 03:45:24 +0000
Subject: Re: Fooling the client into thinking php script is .jpg
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-84215@lists.php.net to get a copy of this message
...however, this may not be the best solution since actual JPEG's accidentally containing the "<?" string will issue errors (!) on your server. The proper way to do this is leave it .php if possible. Bogdan Liam MacKenzie wrote: > Add this inno the appropriate virtual-host > > <Directory "/path/to/the/folder/with/the/jpg/script"> > AddType application/x-httpd-php .jpg > </Directory> > > This will parse all .jpg files to the PHP interpreter. > > Hope that helped! > > ----- Original Message ----- > From: "Matt Moreton" <matt@summy.co.uk> > To: <php-general@lists.php.net> > Sent: Monday, February 11, 2002 11:44 AM > Subject: [PHP] Fooling the client into thinking php script is .jpg > > I have a script that outputs an image. Using the gd library. But the only > way this script gets to execute is if you call it like: > > www.host.com/displayimage.php > > That then sends the content header, and the image. Obviously I am doing > some other stuff in there, which is why I am using a script to generate the > image. Is it possible somehow to request the file as a .jpg? > > www.host.com/displayimage.jpg > > Fooling the client into thinking it is just a .jpg image. > > I tried changing the .htaccess file for the dir this script was in, so that > when a 404 error is genterated, it redirects to the displayimage.php script. > But its not exactly a transparent redirect. If you type an invalid url it > simply redirects, displaying the name of the script, displayimage.php while > loading the image. > > Any suggestions please? > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#84215) next »