Приглашаем посетить
Программирование (prog.find-info.ru)

Random Text

##############################################################################
# Random Text                   Version 1.0                                  #
# Copyright 1996 Matt Wright    mattw@worldwidemart.com                      #
# Created 7/13/96               Last Modified 7/13/96                        #
# Scripts Archive at:           http://www.worldwidemart.com/scripts/        #
##############################################################################
# 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:     #
#               http://www.worldwidemart.com/scripts/faq/                    #
#       3) If you are still having difficulty installing this script, send   #
#          e-mail to: scripts-help@tahoenet.com                              #
#          Include any error messages you are receiving and as much detail   # 
#          as you can so we can spot your problem.  Also include the variable#
#          configuration block that is located at the top of the script.     #
#                                                                            #
# Hopefully we will be able to help you solve your problems.  Thank you.     #
##############################################################################
# COPYRIGHT NOTICE                                                           #
# Copyright 1996 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 it's 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 siaplys 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.

RAND_TEXT.PL -

    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:

	   -----------begin sample random database file--------------
           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.
	   %%
	   Etc...
	   -----------end sample random database file----------------

		If you set $delimiter = "\n";, then the script would assume
		that every line is a separate phrase and randomize the 
		file based on that.

##############################################################################

		How to Implement This In Your Web Pages.

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:

    <!--#exec cgi="/url/path/to/rand_text.cgi"-->

That woudl simply call the program from a Server Side Include and the Random 
Text woud appear in that location on your web page.

##############################################################################
HISTORY

   Version 1.0  - 7/13/95       - First Version Released

##############################################################################

Have fun with this script, but if you can, please follow these rules:

1) If you implement it on a page, please let me know the URL of where it is 
   implemented so I can see my work

and

2) Please keep my name and url in the script itself somewhere, and if you 
would like you could even add it to your page, but that is not necessary.

If you have any questions, let me know and I will try and help!
____________________________________________________________________________
Matt Wright - mattw@worldwidemart.com  http://www.worldwidemart.com/scripts/