Jump to content

Random Image help.


Eugene

Recommended Posts

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.PHP

I 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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.