View Full Version : displaying random images from a folder

07-05-2002, 06:14 PM

Does anyone know of any scripts which will let you display a random image taken from a folder full of images?

All I can find at the moment are scripts which let you specify random images to display.

What I really want is the ability for a script to just wander through a folder full of stuff displaying whatever jpgs, gifs etc that it finds in a random order.


07-05-2002, 08:10 PM
I think you could do that using VBScript.....look for it in VBScript resources. If you want to use a JavaScript, you could place all the images in an array and display one out of them randomly.

07-05-2002, 11:11 PM
As premshree aluded, you can only really accomplish that by using
a server side language. Reasonably easy in PHP :) , I'm sure ASP
could do it, as could perl and vb.

In javascript you'd need to either hold all the image names in an
array or use a rigid numeric numbering system for them.

07-06-2002, 04:25 PM
Thanks for that. I suspected that it was not going to be simple. I don't have any server side scripting facilities, so it's back to the javascript array solution that I'm using.

Thanks though.