		Access counter V2.0a
		--------------------

About the program
-----------------
   As the name implies this program count WWW pages accesses. When this 
 program is used each access to your page increments a counter and displays
 the result in a simple graphic image (XBM format).
   This Version adds a lot to the first version which I wrote offhand to 
 answer my needs. Instead of writing version changes I settle in saying that
 previous version only counted accesses, this one ...

Program description:
--------------------
 Command line options:
   -h       - Prints a short help file.
   -d URL   - deletes URL from the counts log.
   -p URL   - prints URL access counts.
   -s URL N - Sets URL to N counts.
 HTML passed arguments:
   inv=[[off]|on] - Inverse the picture (Black on white, default is off).
   inc=[off|[on]] - Increment the counter (Default is on).
   document=URL   - Name of the document to count.
   filename=URL   - URL on the current machine to download (see below).

   You can (given the right permission) delete entries in the counts log.
 As sometimes you type the wrong name in the URL and ... just call the counter 
 from the command line (using the httpd account) use the -d flag and supply
 the name of the URL you wish to delete.
   Checking the counts for a specific URL is as easy just call the counter from
 the command line (using the httpd account) use the -d flag and supply the
 name of the URL you wish to examine.
  If your wish is to set the access count for a specific URL to zero or 
 whatever comes to mind (cheating ?-) ) just call the counter from the
 command line (using the httpd account), use the -s flag, supply the name of
 the URL you wish the set the count for and the number you wish to be set.
  When invoking the counter from the "<img src=...>" tag you can specify 
 several options "inv" in order to display an inverse image of the picture
 representing the count, When the default is off (no need to specify that of
 course). "document" to specify the name of the document you want to count.
  I add a cool feature which enables you to count the number of times a file
 you make available on the net was downloaded, Use "filename" and pass it
 the name of the URL on YOUR machine. the file MUST be accessible by the
 daemon rules, i.e. you can not use this option to download /etc/passwd for
 example (security must be in mind ;-) ).
  When you use the "filename" variable you may want to use "inc" variable as
 well (see one of the following examples). When you use "inc=off" the counter
 just displays the current count without incrementing it (the default is to
 increment the count).

How to use the counter:
-----------------------
   Just use the "img" tag in your document (anywhere you want) in the following
 manner: <img src=URL?variable1=value&variable2=value> where URL is the string
 you would have used to access the counter from your WWW browser (if you were
 using a computer located abroad. The URL should contain the protocol, host
 FULL name (including domain) and the path to the counter in the cgi-bin
 directory.
   "variable1" ... should be one the the tags listed above and the proper 
 value should be assigned. When using the "document" variable you should use 
 a fully qualified URL name (see the examples below), The same applies for
 the "filename" variable.

What will be seen ?
-------------------
   When everything goes well you should see a number representing the number
 of times the document was accessed.
   If from one reason or the other the counter fails to accesses the counts
 file, etc. you will see an "UnKnown" message.
   If you have defined the counter to serve local users ONLY the a "Local Only"
 message will appear.

Examples:
---------
           Simple way to count:

This page was accessed: 
<img src=http://www.cs.biu.ac.il:8080/cgi-bin/count_g?document=http://www.cs.biu.ac.il:8080/~balder/index.html> times

<img src=http://www.cs.biu.ac.il:8080/cgi-bin/count_g?document=http://www.cs.biu.ac.il:8080/index.html> Accesses to this page so far

You are visitor number 
<img src=http://www.cs.biu.ac.il:8080/cgi-bin/count_g?document=http://www.cs.biu.ac.il:8080/~balder/counter/index.html> 

           Displaying an inverse image of the counter:

This page was accessed: 
<img src=http://www.cs.biu.ac.il:8080/cgi-bin/count_g?document=http://www.cs.biu.ac.il:8080/~balder/index.html&inv=on> times

<img src=http://www.cs.biu.ac.il:8080/cgi-bin/count_g?document=http://www.cs.biu.ac.il:8080/~index.html&inv=on> Accesses to this page so far

You are visitor number 
<img src=http://www.cs.biu.ac.il:8080/cgi-bin/count_g?document=http://www.cs.biu.ac.il:8080/~balder/counter/index.html&inv=on> 

           Using the counter as a filter to count downloads:

<a href=http://www.cs.biu.ac.il:8080:/cgi-bin/count_g_t?filename=http://www.sela.co.il:8080/~balder/Eric.jpg>
<img src=http://www.cs.biu.ac.il:8080/cgi-bin/count_g_t?docname=http://www.sela.co.il:8080/~balder/Eric.jpg&inv=on&inc=off align=top alt=unknown></a>
   
   The last example shows how to use the counter as a filter to counts 
 downloads of the file. 
   The first part sets a link to the counter, i.e. when pressing the link the
 counter will be invoked and the name of the file to be downloaded would be
 passed to it.
   The second part sets the image as the link when the source of the link is
 the counter and the document name is the name of the file. Notice that I
 use the "inc=off" tag here since I don't want the counter to be incremented
 every time someone loads the page, just when someone tries to follow the link.

Supported browsers:
-------------------
   It would have been simpler if all browsers supplied the referring URL, But,
 Since only NetScape does I had to do it that way. In the future, when all 
 browsers will support it ... ;-)
   All browsers that supprt displaying XBM image format should display the
 image, I know that one of Netscapes beta version for windows doesn't display
 that, I hope they would ;-)

BUGS:
-----
  Not that I know of !!!


Bug report, Comments, Compliments, PostCards, etc.:
---------------------------------------------------

Eric Kaplan
balder@sunshine.cs.biu.ac.il
http://www.cs.biu.ac.il:8080/~balder/

  or

Eric Kaplan
Haseora 3
Beit Dagan, 50200
Israel

Copyright & Disclaimer:
-----------------------
 Copyright (C) 1995 by Eric Kaplan.
   The following code is provided as is. You may copy it, distribute is as
 you wish. All this as long as you maintain this header which includes my
 name, this copyright & disclaimer notice.
   The author holds no responsibility for this code. You may use it as you
 wish at your on risk.
   If you like this code, send me a postcard, Email. If you found a bug,
 change the code, please drop me a note at the Email address above.
   If you truly enjoy the program and would like to see more, encouragements 
 can be in Email, Postcard and $10 would encourage even more ;-)
  
                      Eric Kaplan, balder@sunshine.cs.biu.ac.il
                      http://www.cs.biu.ac.il:8080/~balder
