: How complicated is it to make a "random image" viewer thingy ?


Rao!
See name of thread for question.

I had an idea concerning this, but it depends on how complicated it is to do...

Xelopheris
Quite hard. Not only that, but you need certain PHP Addons.

Danno
I pulled this (http://home.att.net/~miller.daniel.r/zo.htm) out of one of my earlier pages; It's a javascript random image trick I used to put random characters in the corner of the page. It originally came from HTML Goodies (http://htmlgoodies.com), but I couldn't find it there anymore, so I just linked it from my site. Save it, replace the images with your own, and you're good to go.

As I have it set up, a random image will appear every time the page loads. Clicking the image will also cause it to load another random image, but if you don't want that feature, just get rid of the <a href></a> tags around the pic. Or move the link tags elsewhere on the page if you want the picture to change when you click a "button." Whatever ya dig, it's pretty flexible.

claytonian
nice I think I'll use this too
edit: but I dont seem to be able to look at the source for some reason?!?
is this not veiwable that way?

Rao!
Thank you !

I'll look into it.

Monkey
Danno's random image thing is the same sort of thing I use: really easy to work.
I don't know why Xelo thinks it's so hard, unless I'm misinterpreting why you need it.

Xoom
yeah im not sure why xelo said it was hard. There are hard ways to do it, i guess, but it's still pretty simple. (I think xelopheris is thinking of php's GD support, now that i think about it)

in php, you could just do something as simple as...

<?php

$images = array("url1","url2","url3");

print "<img src=\"".$images[RAND(0,sizeof($images))]."\">";

?>