Web Analytics Made Easy -
StatCounter displaying random images from a folder - CodingForum


No announcement yet.

displaying random images from a folder

  • Filter
  • Time
  • Show
Clear All
new posts

  • displaying random images from a folder


    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.


  • #2
    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.
    Scripting | JavaScripts | PerlScripts | Python Scripts | Articles | My Journal


    • #3
      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.
      ضkii - formerly pootergeist
      teckis - take your time and it'll save you time.


      • #4
        Thanks all

        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.