phphits v1.1 Beta :: readme

 
PHP/MySQL-based visitor counter
Coded by Johannes Gamba [jgamba@geekfactory.de]
Get the latest version of phphits at www.gamba.de
 
Note
 

phphits is freeware for non-commercial, personal and educational uses. In order to use phphits on a commercial web site, you must acquire a license. Please contact the author to obtain more information!

No warranty is stated or implied. Please use at your own risk.

 
Files contained in ZIP archive
 

demo.php, index.php, install.php, liesmich.html, log.php, loglogin.php, phphits.inc.php, readme.html (this file), reset.php, resetlogin.php, settings.inc.php, setup.php, stats.php, statslogin.php

/digits: 0.gif - 9.gif, /style1-5: 0.gif - 9.gif

 
System requirements
 

In order to use phphits, you must have

• a web server [e.g. Apache: httpd.apache.org]
• PHP 4.x [www.php.net]
• MySQL [www.mysql.com]

running on your system / on your web hoster's server.

 
How to use phphits
 
[1] Extract all files contained in the ZIP archive and upload them to your web hoster's server via FTP (or copy them to the appropriate folder if you have a web server running on your own system).
 
[2] Open the file index.php in your web browser, then click on the top link("Edit settings, create MySQL database and tables"). On the following page, edit the counter settings to fit your needs. It's very important that the MySQL data is correct! After clicking on "Install phphits!", your settings will be stored in a file named settings.inc.php. The counter will also automatically create the MySQL database and tables where it stores its information.
 
[3] After that, you can open demo.php in your browser to see a counter demonstration and to check for yourself if phphits has been installed properly.
 
[4] To use the counter on a web page, open the page with a text editor and insert the following line of code right at the top of the page source:

<?php include "phphits.inc.php"; ?>

All files/pages which include some sort of counter code need to have this line at the top; this is very important. Don't forget that the files phphits.inc.php and settings.inc.php both have to be in the same folder as your web page. Also, all files that include counter code should have a .php-ending in order to be parsed by PHP.

 
[5] To count visitors who visit a certain web page, you need to open the file with a text editor and insert the following line of code right at the top of the page:

<?php phphitsAddHit(); ?>

 
[6] If you want to show the total number of hits on a web page, open it with a text editor and insert the following line of code where you want the counter to appear:

<?php echo phphitsShowHits(0); ?>

NOTE: In order to display phphits and count visitors who visit a certain page, you must use the following code instead of the code in steps 5 and 6.

<?php

// ~~~~~ Include shared functions ~~~~~

include "phphits.inc.php";

// ~~~~~ Count visitors who visit this page ~~~~~

phphitsAddHit();
?>

 
[7] If you also would like to show the number of hits during the last x hours, you need to include the following line of code:

<?php echo phphitsShowHits(x); ?>

where x is the number of hours. For example,

<?php echo phphitsShowHits(24); ?>

will show the number of hits counted within the last 24 hours.

 
[8] You might also want to give visitors of your site the possibility to see how many users are browsing the site at the moment. To add this feature, just add the following line of code:

<?php echo phphitsShowOnlineUsers(); ?>

 
[9] In case you want to see phphits' log file (i.e. a sortable list with information on all the hits counted so far), open loglogin.php in your web browser and enter the correct user name and password.
 
[10] If you want to take a look at the counter statistics, just open statslogin.php in your web browser and enter the correct login data.
 

[11] Last but not least, one day you might want to reset the counter or clear the log. To do this, you need to open resetlogin.php in your web browser and - once again - enter the corrent user name and password. There are 3 different ways of resetting phphits:

• Clear the log (where detailed information on the hits is stored), and reset the counter to 0.
• Clear the log, but keep the hits count (useful if you need some more space in your database, but don't want to lose the number of hits your site has received.
• Keep the log, and reset the counter to 0.

 
That's it - I hope you enjoy using phphits!
 
Version history
 

v1.1 Beta (2002.08.11)

• User-friendly counter setup (setup.php)
• phphits now also works with PHP's setting 'register_globals = off'
• User can define what information is stored in log table (COUNTER_REC_... settings)
• Counter settings now stored in settings.inc.php
• Optimized MySQL-related code
• Counter also saves name of page visitor is looking at (new table column!)
install.php: Different way of checking if DB/tables already exist
• Renamed some files (phphits.inc.php, resetlogin.php, reset.php)
• Readme now available as HTML page
• Minor changes and improvements

v1.01 Beta (2002.08.07)

stats.php, statslogin.php: simple counter statistics
install.php: phphits now checks if DB/tables already exist
phphits.php: restructured settings part
phphits.php: new setting SQL_LOG_HITS (can save DB space)
• Minor changes

v1.00 Beta (2002.07.23)

• Separate MySQL table to save hits count
reset.php: Different ways of resetting counter / clearing log file
install.php: New page to create MySQL database and tables
index.php: counter "control center"
• Log file: referrer info shown as hyperlink
• Log file: Number of rows shown can be changed (STATS_NUM_HITS)
• Log file: Smaller file size by using CSS
• Minor bugfixes / changes in design

v0.99 Beta (2002.02.08)

• Counter now saves info about referrer (page a visitor comes from)
• Changed MySQL table structure
• Optimized code (especially database queries)
• Added option to deactivate DNS host lookup
• Logfile can now be sorted by different criterias
• Minor changes in design

v0.951 Beta (2001.10.11)

• Minor fixes
• Fixed HTTP_X_FORWARDED bug

v0.95 Beta (2001.06.04)

• phphits now features 2 modes (text-based, image-based)
• Minor fixes

v0.92 Beta (2001.06.01)

• Added "reset counter" feature (reset.php, reset_action.php)

v0.91 Beta (2001.02.13)

• Fixed COUNTER_HITS_OFFSET bug

v0.9 Beta

• First public release

 

Coded by Johannes Gamba