                    Graphic Page Counter Script

Ranson - artsrch@ro.com

This script is written in PERL for UNIX operating system. Since I have no 
experiance with NT, I am unsure if the script will work on NT.

Although this script was designed to be your 'index' page or (opening page)
it dosent have to be. You can rename the script to whatever you want as
long as the extention is .cgi (script_name.cgi). If used as your index page,
the address of your homepage is: http://www.your_page.com/~you/  --  it is 
not necessary to include the name index.cgi in your address unless you want 
to. On a UNIX server if no HTML page is specified in the address, then UNIX
looks for an 'index' page, and that page is returned to the user.
(*)
NOTE: some servers use 'home.htm' or 'home.cgi' as the opening page - check
with your administrator if you need help with that. If after you read the 
FAQ on CHMOD (file permissions) you still don't understand what to do, ask
your administrator for help, this is not something I can do for you, because
of securiety on your server.


This is a very simple script to use and set-up. It uses your home page HTML
file just as you have it now. This makes the script easy to use for the 
novice to CGI's. The script is named index.cgi(*) and it goes in your
main or opening directory. When the script is called it opens your existing
HTML page and prints it to the screen along with the page count. It is just
that simple.

If you want to gather statistics on who is viewing your page, use the 
'main.log' - Create a file called 'main.log' and put it in the same 
directory with the index.cgi and the count.log (chmod 666 main.log)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

YOUR-HOME-DIRECTORY   (Where your pages are now)
	|
	|
	index.cgi
	count.log
	main.log   (optional)
	home.htm   (or the name of your home page - *not index.html)
		|
		|
		NUMBERS-DIRECTORY   (Make a directory called 'numbers' and
			|            put the number gif's in here)
			|
			one.gif
			two.gif
			--ETC--

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

There are 2 main files to the script, index.cgi, and the count.log. 
The count log has one line with a number on that line, this is the page 
count. You can start with any number you like, the count.log file has the 
number 100 in it as the starting number presently.
The script opens that file and retrives the number adds 1 to it 
and prints the new number to the file. Then prints the new number to the
bottom of your home page.  
You can select if you want the numbers centered or left justified. The 
count can be in a table or you can select to not use the table.

I have included two sets of numbers, gifs, 0 through 9. Numbers is black 
on white and numbers2 is black on yellow. Or make your own numbers if you 
want to customize your counter. I suggest you make a 'numbers' sub-directory 
and put all the images into that dir.

chmod the index.cgi to 755 (Confused? see the FAQ on CHMOD on my homepage)
chmod the logs to 666

These are things you will need to change in the index.cgi:

(*) ### IMPORTANT! If the name of your home page is presently 'index.html'
        you must change the name. You can not have 2 files named 'index'

# What is the name of your home page?
$home_page = "home.htm";

# What is the name of your count_log?
$count_log = "count.log";

# Where are your images? put complete path (if they are in the same Dir. as
# this script, just comment out the $img_dir line with the # (#$img_dir)
$img_dir = "numbers";

# What is the name of your main log?  it is not necessary to use this log
# but it is good for gathering statistics. 
$mainlog = "main.log";


These are things you can change if you like:

# Text that appears before the count number
$before = "You are visitor number";

# Text that appears after the count number
$after = "to this page";

# You can change the font color for the counter 000000 = Black
$font_color = "<FONT COLOR=\"306DA5\">";

# You can chang the font size of the counter text
$font_size = "<FONT SIZE=\"3\">";

# Do you want the counter text centered? 1=yes 0=no
$center = '1';
