Counter installation


1.1 - Extract the package on the server

Download the W3Perl package and extract it on your web server root, it will create a /w3perl/ directory.
Copy the /w3perl/resources/counter/goto.php script in your web directory. You can change the script name if needed. Best is to put this script in a subdirectory (let's say /count/).

1.2 - Customize php script

Edit this script and change the link array : indice is the id you will give to the script argument, value is the URL where the visitor will be sent to (your href value). Set also $link_default which should be your domain URL (will be used if someone try to send an invalid id).

1.3 - Permission

Change permission or owner to your subdirectory in order to allow your web server to write within. You can password protect this directory to avoid unsolicited accesses.

1.4 - Edit your external links

Edit your links in your html pages and change your href value with the path to the php script. For instance, if you have <A HREF="http://www.google.com/">, it will give <A HREF="counter/goto.php?id=1"> if $link[1] is set to "http://www.google.com/" in the goto.php script.

1.5 - Show clicks number

To display clicks number, add first at the beginning of your page : <?php require_once 'count/show_counter.php'; ?> if your show_counter.php is located inside your count directory.
To view click for a specific id, use : <?php echo display_counter(4); ?> where 4 is the id.

1.6 - Analyze logfile

Wait a few days to accumulate some data and run W3Perl using your access_log logfile.