Jump to content


Photo

Random Image help.


  • Please log in to reply
2 replies to this topic

#1 Eugene

Eugene
  • Members
  • PipPipPip
  • Advanced Member
  • 126 posts

Posted 12 August 2006 - 03:06 PM

I was able to successfully write a random image generator via where you can view the image: image.php ...

Heres the script:

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);

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?

#2 Eugene

Eugene
  • Members
  • PipPipPip
  • Advanced Member
  • 126 posts

Posted 15 August 2006 - 01:23 AM

BuMp.

#3 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 15 August 2006 - 01:44 AM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users