Unicounter is a versatile program designed to count page-hits or file downloads. It can work with or without SSI.Unicounter is a versatile program designed to count page-hits or file downloads. It can work with or without SSI.
Installation
Unicounter is a perl script. If you wish to use a single instance of Unicounter to maintain counters for several pages and/or downloads, it should be installed in its own directory. Normally you will have to place it within a subdirectory of /cgi-bin. e.g. create a directory called counters in the /cgi-bin directory and upload unicounter.pl into this directory. When uploading, you must use ASCII mode otherwise the end-of-line markers may be invalid and the script will fail.
You must set the access rights of the script file and the directory to 755. If you have command-line access to the server, this is typically done using the chmod command. If you are using Internet Explorer, right click the directory and choose properties from popup menu. An array of boxes will be displayed representing 9 attributes. The Owner must have complete access (all three boxes ticked). Other groups should be given execute and read access. Repeat this process for the script file unicounter.pl
To verify that it has been installed correctly, open a browser window and type in an url of the form :-
http://www.yourdomain.com/cgi-bin/counters/unicounter.pl?name=test&create=23
If it is working correctly, the returned value should read document.write('23');
Page-hits counter
In it simplest form, you just need to add the following to your webpage (use source mode not wysiwyg mode).
Server-side includes
The server-side include version is somewhat simpler but may not be available on all servers or may need activation. You must add something like the following to your web page. Again, you must perform editing in source mode.
Page hits =
The text "Page hits = " will be displayed before the value of the counter.
Download counter
Your existing link will look something like this.
Click here to download
This will have to be adjusted to read something like this.
Click here to download