Random Image Picker
For Windows NT/95
Version 1.5
Table Of Contents
Downloading
Download rand.zip
Proceed to Installation.
Back to TOC
Installation
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...
|
|--/doc
|
|--rand.html <--this document
|--rand.readme <--readme file
rand.exe will create the file rand.err to log errors.
Back to TOC
Usage
Using rand is very easy. There are two steps:
- 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"
- In your HTML, put something like this:
Replace list.txt by whatever you named your list of files.
Example
The image on the right side of
this page changes everytime
you hit RELOAD.
The HTML that does this is:
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
Troubleshooting
P: I get the broken image symbol.
S: Try right clicking on the broken image symbol
and selecting "View this image as...".
- It says Server Misconfiguration error
Your server is misconfigured. Consult your manuals. Maybe the general
FAQ will help you.
- It asks where should I save rand.exe!?
It asks me to configure a viewer of type application/octet-stream!?
Your server doesn't realize that the /cgi-bin directory is where CGI
programs live, that CGI programs should be executed, not downloaded.
Check your server setup and consult your manuls. Maybe the general
FAQ will help you.
- It says "Can't create child process?" or something like that
If you are using WebSite, try deleting all the *.in and *.out file in your
\TEMP directory. If you aren't using WebSite, or if that didn't
help, your server may be out of memory. If the problem persists, try
rebooting your server.
- It says something else, or nothing at all
E-mail me the following info:
- Your URL
- What it does say
- If there is a file called rand.err, and if so, what does it say
- The server you are using
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
FAQ
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
Credits
- Rand uses the gd library
by Thomous Boutell. The gd library is copyright © Thomous Boutell.
- Thanks also to my dad.
Back to TOC