Eugene Posted August 12, 2006 Share Posted August 12, 2006 I was able to successfully write a random image generator via where you can view the image: image.php ...Heres the script: [code=php:0]header("Content-type: image/png");$images = array();$images[1] = "***";$images[2] = "***";$images[3] = "***";$images[4] = "***";$imgPng = imagecreatefrompng($images[rand(1, 4)]);/* Output image to browser */imagepng($imgPng);imagedestroy($imgPng);[/code]How can I make the file be viewable as image.PNG instead of image.PHPI tried .htaccess but it's extremely slow at it. Help anyone? Quote Link to comment Share on other sites More sharing options...
Eugene Posted August 15, 2006 Author Share Posted August 15, 2006 BuMp. Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted August 15, 2006 Share Posted August 15, 2006 Save it to the file system, then call it from your html page. Or, change the .png extension to be associated with php so that the php intrepreter will read it...but I'm not sure about the side effects of that on it processing the .png files. 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.