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] 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. |
That's it - I hope you enjoy using phphits! |
Version history |
v1.1 Beta (2002.08.11) User-friendly
counter setup (setup.php) v1.01 Beta (2002.08.07) stats.php,
statslogin.php: simple
counter statistics v1.00 Beta (2002.07.23) Separate
MySQL table to save hits count v0.99 Beta (2002.02.08) Counter
now saves info about referrer (page a visitor comes from) v0.951 Beta (2001.10.11) Minor
fixes v0.95 Beta (2001.06.04) phphits
now features 2 modes (text-based, image-based) 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 |