My other scripts
Switch to Polish

The Clicks Counter script

Actual version

1.0 (9 Dec 2008)

Description

This script counts a number of clicks of outbound links. It is a modified version of James Caws's PHP script. To use the script you don't have to modify outbound links - more details can be found at his page. I made the following modifications:

Installation

  1. Download the "ccounter.zip" file, unpack it, and copy extracted files to appropriate directory
  2. Edit the "ccounter/tracker.js" JS script and configure it as James Caws wrote
  3. Edit the following PHP scripts: "ccounter/logger.php" and "ccounter/admin/index.php", and configure them, i.e., find and modify the value of two variables:
    DBname
    It contains the filename (plus a path) of the SQLite database. Remember that the file (DB) and the directory it is in, have to be writable by the web server
    Log
    0 means "Log shouldn't be created", 1 means "Log should be created". This variable is contained in the "ccounter/logger.php" file only
  4. The last step - citation from James Caws's page: The JavaScript should be included at the end of your pages that you want to monitor the click throughs of. If you have a general ‘footer’ template, this should be easy. Whatever your scenario, ensure the include is just before the tag. e.g.:
    <script type="text/javascript" src="/ccounter/tracker.js"></script>
    
    </body>
    
For security reasons you DB shouldn't be accessible from the web, i.e. keep the SQLite always out of the htdocs. You should also protect the "ccounter/admin/index.php", e.g. make the http://www.yourpage.com/ccounter/admin/ page protected by password - see Apache HTTP Server Version 2.2 Documentation.

it requires PHP 5.1 (or higher)

Document last modified: Tuesday, 09-Dec-2008 12:52:30 CET



Stanislaw Polak,