Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

In need of image randomizer

I need an image randomizer url maker thing so I can input 5 images and it pulls out 1 url that shows one of the images randomly every time the web page is refreshed.
So it's input 5 urls, output 1.
I tried Image Ox but that doesnt upload images, so are there any others I can use?
Please help. Thank you guys!
 
You can make PHP do images like that.
PHP:
header("Contet-type: image/png");
$img = "myimage.png";
if(!($fp=fopen($img,"rb")))
{
print("Could not open the URL.");
exit;
}
$contents=fread($fp,1000000);


print($contents);
fclose($fp);

With some tweeking, you can make random images! Woo!
 
Xilef: You can't do it in a signature. Your best alternative would be to link to a single image file, and just change that image file every so often.
 
http://yeyindedev.ceroprojects.com/content/img.php[/img]

It's a random image, done in PHP! My above code was wrong, so here is some working code:

PHP:
<?php
//INITIALIZE RANDOM GENERATOR
srand((float) microtime() *10000000);
//IMAGES TO BE DISPLAYED
$imagefiles = array("img1.png", "img2.png", "img3.png");
//GRAB A RANDOM FILENAME FROM THE ARRAY
$imagefiles = $imagefiles[rand(0,count($imagefiles)-1)];
//PATH WHERE THE IMAGES ARE STORED ON OUR WEB SERVER
$path = $imagefiles;
//TELL THE BROWSER WE ARE SENDING AN IMAGE
header("Content-type: image/png");
//OPEN THE IMAGEFILE
$png = fopen($path,"r");
//READ THE IMAGEFILE
$image = fread($png,filesize($path));
//SEND IT DOWN THE PIPE
echo $image;
?>
 
exclude;309009 said:
Xilef: You can't do it in a signature. Your best alternative would be to link to a single image file, and just change that image file every so often.
Yes, you can, I've seen it done multiple times and Image Ox has done it too, I've used it before but now it's not working so I'm looking for a different one.
No more PHP please, I've already said I'm not using PHP.
Thanks for trying guys. I've seen a member on these forums with a sig that changes everytime you refresh the page but I dont know who it was, they could probably help me here.
EDIT: Impossible? Yeah right. Found it: http://www.imagerotation.com/
There are millions on the www, just that some restrict image heights and such >.<
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top