home | portfolio | stuff | links | contact


phphitlog is a simple hit counter that keeps track of all hits to a particular page. it is made for websites with a small number of visitors.
installing is very easy: just 1 file to upload!

it saves:
  • the time
  • IP and hostname of the visitor
  • browser and OS used
  • the page that referred to the visited page
you need PHP installed, but no database is required!
the pages are tracked through a transparent image on the webpage.
because the image is on your server, it will not slow down your site.

latest version: phphitlog 0.8.5
- bug fix in cookie settings
changes in 0.8:
- one-file installation and configuration
- small lay-out changes
- infile password protection
- browserinfo in statusbar instead of hoover

see a screenshot


  1. download phphitlog 0.8.5
  2. make a new directory on your site (ie: stats), and chmod it 777 (set permissions)
  3. upload "install.php" in the directory you just made.
  4. browse to install.php via your URL (ie: http://www.mydomain.com/stats/install.php)
    and follow the instructions presented.
  5. delete install.php if the script didn't do it (non UNIX systems).
  6. to track a webpage: (with an image, click here to use the infile function)
    - open your webpage with an editor.
    - paste these lines somewhere on your page:

    <script language=Javascript>
    document.write("<img src=count.php?ref="+document.referrer+" width=1 height=1>");

    - change count.php to the relative path to count.php if necessary (ie: stats/count.php).
    - upload the page to your server.
  7. to see your stats:
    - browse to the stats directory via your URL (ie: http://www.mydomain.com/stats)
    - click the month to see the hits.


during the installation you can choose a password, IP numbers that are excluded from tracking and an option if you want to use a Javascript image or infile php.

if you choose to include the count script into your PHP page, you don't have to use an image or javascript.
the filename of your webpage should end on .php (or equal)
  1. open your webpage with an editor.
  2. paste this line somewhere on your page: <? include("count.php"); ?>
  3. change count.php to the relative path to count.php if necessary.
  4. upload the page to your server.

chmod 777?

you have to set your directory so the script can write the necessary files to it.
for that you need to set 'permissions'.
in UNIX terms this is called CHMOD and the 777 means read, write and execute for all.
this can be done with most FTP programs, by selecting the directory's 'properties' or 'info' or something
check your FTP program's help to see how to set permissions.
the ftp command is: ftp> chmod 777 phphitlog

 screenshot from Transmit for Mac.

©2002 mr10.org | maarten callebert