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? Link to comment https://forums.phpfreaks.com/topic/17334-random-image-help/ Share on other sites More sharing options...
Eugene Posted August 15, 2006 Author Share Posted August 15, 2006 BuMp. Link to comment https://forums.phpfreaks.com/topic/17334-random-image-help/#findComment-74871 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. Link to comment https://forums.phpfreaks.com/topic/17334-random-image-help/#findComment-74873 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.