AJay17 Posted November 17, 2007 Share Posted November 17, 2007 I've created a script that dynamically generates an image. It is a php file that can be called inside of an image tag. The site that it will be used on mainly does not display images with php extensions. Is there any way I could give it a jpg extension and my server still process it as jpg? See the image below as an example. The site is somehow setup to where the image will change dynamically based on what the filename is. I really need to do it this way, any ideas? http://card.mygamercard.net/AJay18.png Quote Link to comment Share on other sites More sharing options...
rarebit Posted November 17, 2007 Share Posted November 17, 2007 This has bemused me, not found the way naming it within the header, yet you can save it to file and redirect to it... Just remember to delete it. Hopefully someone else will have a better answer to this! Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted November 17, 2007 Share Posted November 17, 2007 yes, but it has nothing to do with php. You use modurl/ urlrewirtes, and basicalyl you make a pseduo folder so when someone goes to http://www.mysite.com/images/5.jpg the apache will actually execute the script at http://www.mysite.com/scripts/dynamic_image.php?id=5 make sense? it takes a bit of work to do, and this isn't the location to has it answered, but that is the idea behind it. So the user actually lands on what they think is a .jpg page, but actually it executes a different page. Quote Link to comment Share on other sites More sharing options...
AJay17 Posted November 18, 2007 Author Share Posted November 18, 2007 any chance you can point me to where I would find info on doing this. I googled and didn't find anything very helpful. Quote Link to comment Share on other sites More sharing options...
~n[EO]n~ Posted November 18, 2007 Share Posted November 18, 2007 Search for mod_rewrite and URL rewriting on google http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html http://www.yourhtmlsource.com/sitemanagement/urlrewriting.html Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted November 18, 2007 Share Posted November 18, 2007 Another way to do it is to set up apache to parse .jpg files as .php files. If you were to stick the following code in a .htaccess file in a sub-directory: AddType application/x-httpd-php .jpg Apache would parse your .jpg files in that folder as php files. Thats why i say put it in a sub-folder, otherwise none of your normal jpg images would work! It's how i got the picture in my signiture to work. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.