Random image generator

The randimg.cgi CGI program is a simple CGI program which allows a random image to be displayed. The displayed image will be any image in a directory you specify.

The basic idea is that you specify the program name and give a directory like:

    <img src="http://www.peak.org/cgi-bin/randimg.cgi?directory">
    <img src="http://www.peak.org/cgi-bin/randimg.cgi?~regan/Images/">
Unfortunately, some browsers treat the above as a cachable item. If you want more than one image in the web page, change the URL such as:
    <img src="http://www.peak.org/cgi-bin/randimg.cgi?~regan/Images/&1">
    <img src="http://www.peak.org/cgi-bin/randimg.cgi?~regan/Images/&2">

To avoid allowing people to look at just any directory, this program requires that the file .ImageDir exist in the directory containing the images.

You can pick up a tar archive of this package to run on your site.


Last modified 20 Feb 1998
Dave Regan

Comments to: PEAK Support Team