GCount 0.71

gcount is a graphical web counter and logging script.  It requires at minimum, PHP 4.1+, 
GD 1.8.3+, and MySQL 3.22+

Simply extract the archive to a location readable by your PHP/GD enabled web server.  
Point your web browser to http://your.domain.com/path/install.php and 
follow the on screen forms to create the necessary MySQL tables.  It will require 
that you create that gcount database, and create a user with access to that DB.  

CREATE DATABASE gcount;
GRANT SELECT, INSERT, UPDATE, DELETE ON gcount.* TO gcount@'%' IDENTIFIED BY 'count123';

Note: GCount does NOT need it's own database, just its own tables.  If you have a 
      pre-existing database just use that and give GCount and appropriate username
		and password to access that database.

Once you have successfully installed GCount you can use it on your webpage by copying
and pasting the following code to your website.  Changing the necessary elements of
course.

It is recommended that you delete the install.php file afterwards, as it is a 
potential security risk.

-----

This is my counter below:
<P>
<a href="http://your.domain.com/path/gcountinfo.php?name=gctest">
	<img src="http://your.domain.com/path/gcount.php?name=gctest&digits=5&typeface=7&log=1" alt="" />
</a>

-----

GCount has several configurable parameters that can be passed via CGI.  The most
important is name.  In the above example name is gctest for this counter.  Each
seperate counter will needs its own unique name.  Changing the typeface variable
will let you change the display font that GCount uses to display the counter.  A
value of -1 will cause GCount to use a random typeface each time the counter is
requested.  Lastly the digits parameter controls the number of digits to display
padding with zeros any empty spots.

** IMPORTANT ** IMPORTANT ** IMPORTANT ** IMPORTANT ** IMPORTANT ** IMPORTANT  **

If you want GCount to log user agent (Browser and OS information) you will need to 
send log=1 to gcount as an option (see above).  Otherwise GCount will act as a simple
counter only logging hits.

If you are having problems getting the counter to display I recommend that debug your
problem by going directly to the gcount.php instead of trying to view the counter in
your webpage.  If GCount gives an error you will see it as a broken image in you web 
browser, going directly to gcount.php may give you some clues as to what the problem is.

Note: this PHP script requires that the GD libraries are installed.  You can get them
from: http://www.boutell.com/gd/  Note: RedHat installs the required libraries by 
default.

If you are having web hits that are being reported incorrectly by viewing 
gcountinfo.php have that same web visitor view http://your.domain.com/path/agent.php
and email me the output.  Some web browswer do not comply with standard agent tags.
By sending me the string I can update a future version of Gcount.

This script has been tested with PHP 4.3.x, gd 2.x, and MySQL 3.x.  If
you have any questions or comments please contact me at: scott@perturb.org

To see the script in action go to http://www.perturb.org/ and scroll to the 
bottom of the page.

///////////////////////////////////////////////////////////////////////////
// Options
///////////////////////////////////////////////////////////////////////////

name       = (name) specifies all hits will logged under this name
digits     = (1-10) number of digits to show, will be zero padded
number     = (x) a specific number the counter should display
log        = (0/1) turn agent logging on or off
visitlimit = (x) length of time (in minutes) a session will count as (overide 
             the default)
typeface   = (x) number of the typeface to use, you can use -1 to use a 
             random typeface
debug      = (1) if specified gcount will print lots of debugging information
             instead of a counter
showall    = (1) if specified gcount will display all the available typefaces


All of these options are appended as follows:

gcount.php?(option=value)&(option=value)&(option=value)

///////////////////////////////////////////////////////////////////////////
// Options
///////////////////////////////////////////////////////////////////////////

Scott Baker
6-20-2003
