Patriot Posted February 17, 2008 Share Posted February 17, 2008 The following works fine if I go to that php page, but I was wondering how I can go to an image file and see that, such as banner.png ============================================================== <?php /* Now for the GD stuff, for ease of use lets create the image from a background image. */ $banner = imagecreatefrompng("sigbackground.png"); /* Lets set the colours, the colour $line is used to generate lines. Using a blue misty colours. The colour codes are in RGB */ $goal = $_GET['g']; $black = imagecolorallocate($banner, 0, 0, 0); imagestring($banner, 5, 20, 10, "Current Freebie Goal: " . $goal, $black); imagestring($banner, 5, 20, 20, "sup", $black); /* Output the image */ header("Content-type: image/png"); imagepng($banner); ?> Link to comment https://forums.phpfreaks.com/topic/91459-dynamic-image-question/ Share on other sites More sharing options...
tippy_102 Posted February 17, 2008 Share Posted February 17, 2008 You mean like this? <img src="image.php" alt="php generated image" /> or do you want to save the image for later use? Link to comment https://forums.phpfreaks.com/topic/91459-dynamic-image-question/#findComment-468603 Share on other sites More sharing options...
Patriot Posted February 17, 2008 Author Share Posted February 17, 2008 I mean if someone goes to image.png, not .php, it will show the generated image. For example site.com/imageinfo/image.png Ex: http://www.3604free.com/goods/14430203.png Link to comment https://forums.phpfreaks.com/topic/91459-dynamic-image-question/#findComment-468642 Share on other sites More sharing options...
able Posted February 17, 2008 Share Posted February 17, 2008 You can use mod_rewrite or the file directive in httpd.conf or .htaccess Link to comment https://forums.phpfreaks.com/topic/91459-dynamic-image-question/#findComment-468644 Share on other sites More sharing options...
tippy_102 Posted February 17, 2008 Share Posted February 17, 2008 If you want the image generated on the fly, use what I gave you above, if you want them to view a saved image, place this in your code in your php file: imagepng($banner, 'image.png'); Link to comment https://forums.phpfreaks.com/topic/91459-dynamic-image-question/#findComment-468648 Share on other sites More sharing options...
Patriot Posted February 18, 2008 Author Share Posted February 18, 2008 Haha thanks everyone! mod_rewrite did the trick! Ex: http://freebiemachine.com/images/sig/100.png Change 100 to whatever you want Link to comment https://forums.phpfreaks.com/topic/91459-dynamic-image-question/#findComment-469260 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.