Random Image Picker

For Windows NT/95

Version 1.5

Table Of Contents


Download rand.zip

Proceed to Installation.

Back to TOC


Unzip rand.zip in your /cgi-bin or /cgi-shl directory. (I don't know what you're talking about...). If you are using WinZip, make sure that "Use Directory Names" is checked. If you are using PKUNzip, make sure to use the -d option.

The following files and directories will be created:

  /cgi-bin (or /cgi-shl)     <--server's CGI directory
    |--rand.exe              <--the actual script
    |--error.gif             <--in case of error...
    |--error.jpg             <--in case of error...
         |--rand.html        <--this document
         |--rand.readme      <--readme file
rand.exe will create the file rand.err to log errors.

Back to TOC


Using rand is very easy. There are two steps:
  1. Create a file that lists, one per line, the filenames of the images that you would like rand to pick from. Be sure to use full path names. Make sure that they are either JPEGs or GIFs. Also make sure that their extensions are either .jpg or .gif respectively. Save this file as, for example, "list.txt"
  2. In your HTML, put something like this: <img src="/cgi-bin/rand.exe?list.txt"> Replace list.txt by whatever you named your list of files.

The image on the right side of this page changes everytime you hit RELOAD.

The HTML that does this is:

<img src="/cgi-bin/rand.exe?russia.lst" align=right> and the file russia.lst looks like this: c:\internet\http\gif\moscow.jpg c:\internet\http\gif\moscow2.jpg c:\internet\http\gif\moscow3.jpg c:\internet\http\gif\moscow4.jpg c:\internet\http\gif\moscow5.jpg c:\internet\http\gif\moscow6.jpg Of course, you don't need to name your images sequentially like this, and they don't need to be in the same directory. You can also mix .jpg's with .gif's.

Back to TOC


P: I get the broken image symbol.

S: Try right clicking on the broken image symbol and selecting "View this image as...".

P: I get this:

S: One of the files you listed couldn't be opened for reading. Check rand.err for the filename, and then check to make sure it is there or that you don't have a typo in your list file.

P: For some browsers, this doesn't work.

S: Yes, I've heard this doesn't work for some browsers. They are inferior, then, if they can't handle .exe files being images. All the major browsers, Netscape, MS Explorer, and Mosaic do work with this.

Back to TOC


Q: Can I use wildcards in my list file?

A: Not in this version. I hope to incorporate that feature in the next version.

Q: Can I have more than one list file?

A: Of course. Just make sure to specify the correct one after the ? in your HTML

Q: I want to be able to display a random picture, and then have people click on it and take them to that picture's creator (e.g. I want a list of sponser's logos randomly displayed and a user clicking on the logo will go to that page)

A: I'm afraid there is no easy way of doing this with just rand.exe. I might make a JAVA applet that does this in the future.

Back to TOC


Back to TOC