COPYRIGHT

Random Image Displayer Version 1.00
Copyright 2001 London Perl Mongers, All rights reserved

LICENSE

This script is free software; you are free to redistibute it
and/or modify it under the same terms as Perl itself.

URL

The most up to date version of this script is available from the nms
script archive at  <http://nms-cgi.sourceforge.net/>.

SUMMARY

rand_image chooses a random image from a set of predefined images and
displays it on a webpage.

FILES

In this distribution, you will find three files:

rand_image.pl - The main perl script.
README        - This file. Instructions on how to install and use rand_image.
MANIFEST      - List of files

CONFIGURATION

There are a number of variables that you can change in rand_image.pl which
alter the way that the program works.

$DEBUGGING    - This should be set to 1 whilst you are installing
                and testing the script. Once the script is live you
                should change it to 0. When set to 1, errors will
                be output to the browser. This is a security risk and
                should not be used when the script is live.

$basedir      - The URL of the directory where your images are located. For
                example: $basedir = 'http://your.host.com/images/'. This
                value should end with a trailing '/'.

@files        - The lsit of image files that the random image is chosen from.
                These filenames will be appended to the $basedir variable and 
                thus should be relative to $basedir. For example,

                @files = qw(logo.gif people/john.jpg animals/cat.png);

                If you take the $basedir variable from the previous example, 
                you would get a set of three images:

                    http://your.host.com/images/logo.gif
                    http://your.host.com/images/people/john.jpg
                    http://your.host.com/images/animals/cat.png

$uselog       - Set this value to 1 to log which image is returned each time
                the program runs.

$logfile      - The path to the logfile, only needed if $uselog = 1. This file
                must be writable by the webserver. For example, 

                    $logfile = "/tmp/randimages.log";

INSTALLATION

rand_image is installed simply by copying the file rand_image.pl into your
cgi-bin directory. If you don't know where your cgi-bin directory is, then
please ask your system administrator

You may need to rename rand_image.pl to rand_image.cgi. Again, your system
administrator will know if this is the case.

You will probably need to turn on execute permissions to the file. You can
do this by running the command "chmod +x rand_image.pl" from your command
line. If you don't have command line access to your web server then there
will probably be an equivalent function in your file transfer program.

Then, edit your HTML files and change all the images that you want to
be randomized to:

<img src="http://your.host.com/cgi-bin/rand_image.pl" />

This is just an example, so be sure to insert the correct URL of your
rand_image.pl installation.


SUPPORT

For support of this script please email:

  <nms-cgi-support@lists.sourceforge.net>

