|Select from the following table of contents to jump to a specific area within this README file. This is a HTML version of the README file distributed with Random Text.
|Random Text||Version 1.0|
|Copyright 1996-2002 Matt Wrightemail@example.com|
|Created 07/13/96||Last Modified 07/13/96|
|Matt's Script Archive, Inc.:||http://www.scriptarchive.com/|
|If you run into any problems while trying to configure this scripts, help is available. The steps you should take to get the fastest results, are:|
1) Read this file thoroughly.
2) Consult the Matt's Script Archive Frequently Asked Questions:
3) If you are still having difficulty installing this script,
you may wish to look at the resources listed here:
Hopefully that will be able to help you solve your problems. Due to time
constraints I can no longer offer technical support for this code.
Copyright 1995 - 2002 Matthew M. Wright All Rights Reserved.
Random Text may be used and modified free of charge by anyone so long as this
copyright notice and the comments above remain intact. By using this
code you agree to indemnify Matthew M. Wright from any liability that
might arise from its use.
Selling the code for this program without prior written consent is
expressly forbidden. In other words, please ask first before you try and
make money off of my program.
Obtain permission before redistributing this software over the Internet or
in any other medium. In all cases copyright and header must remain intact.
|Random Text is a program which takes a plain text file, which contains a series of phrases, quotes, lines of text, etc... and a delimiter (the character(s) which separate each entry) and will randomly choose one of the phrases and display it on your web page. This requires the use of Server Side Includes, which you can read more about at the FAQ URL listed above.
There are two files included with this script:
1. README - This file; includes detailed installation instructions.
2. rand_text.pl - The Perl script which generates the random phrase and displays it on your web page.
The rand_text.pl file has two variables which must be modified. You then must place this file in a special executable directory (usually called cgi-bin) or rename it to end with a .cgi extension if your server is set up that way.
|There are two variables in this program which must be modified:
$random_file = "/path/to/random.txt";
This variable points to the location of the file which contains the phrases which you wish to have randomly displayed. This shoul dbe a system path and not a URL.
$delimiter = "\n\%\%\n";
This specifies what separates each record. If you leave it as the default, your $random_file database should look like:
Phrase one would go here.
As much white space or formatting as you want.
Second Phrase would go here.
And the next
Second line of the next.
If you set $delimiter = "\n";, then the script would assume that every line is a separate phrase and randomize the file based on that.
This script must be called as a Server Side Include, or it can also be called on a page by itself (however that is not as nice looking.) Below are some examples of how to call this program:
That would simply call the program from a Server Side Include and the Random Text woud appear in that location on your web page.
|Version 1.0 07/13/95 ||- First Version Released.