Active Web Hosting Logo
FAQ Index Getting Started Your Account Domains Web Site & Hosting E-Mail
FTP CGI PHP Scripting MySQL Database Script Installation Legal Information

Installing A Visit Counter

In order to install a counter, you will need to have an activated CGI account. Please see How To Request A CGI Account for more information.

There are many free counter services on the internet. However, some may share data from your web site with some of their partner sites. The most secure counter is one you host on your CGI server yourself. We will cover one of them here along with basic installation instructions. Counters are probably some of the easiest and most useful scripts to install.

Basic Visit Counter

This is a very basic low-traffic visit counter. It assumes your visitors have JavaScript turned on. Most counters require this and most visitors do have this feature turned on by default in nearly all browsers. The script installation is very simple:

  1. Download the counter here.

  2. Extract the files from the .zip file by using an unzip utility such as WinZip for Windows. Other operating systems may have similar utilities for extracting files from a .zip archive.

  3. Upload the following files to your server's cgi-bin directory: counter.cgi, counter.txt, and counteriplog.txt

  4. Set the file permissions for counter.txt and counteriplog.txt to 666.

  5. Set the file permissions for counter.cgi to 755.

  6. In your web page html file, you can set up the counter one of two ways:

    1. If you use a .css style sheet, add the following code to your css stylesheet file:
            .counter {
               font-family: arial, sans, verdana;
               font-size: 8pt;
               color: #000000
      Change the font family (font style), size and color to suit your site's needs.

      Now edit your html file by placing the following code where you want the counter to be displayed. Change the [DATE] to read the date you installed your counter.

    2. Add the following code to your html file where you want the counter to appear. Edit the <font> tag and [DATE] as needed.

Advanced Settings:

Inside the counter.cgi you can edit the # Variables area to suit your needs. For example, $tlimit can be adjusted to allow less or more time before counting a page visit. By default it's set to 120 seconds (2 minutes).

You can also set the $iplog and $countlog to use different files. Be sure that you already have a file on your server for each and the file you specify for $countlog must contain a number as the first line and no other text.


This tutorial might not have been written during the release of the most current version of this script, but may work with newer versions. It is the domain owner's responsibility to be sure that any script that is run on their CGI server is secure and stable. This means making sure that the script and all it's associated files are of the most recent stable and secure version available.

Home - Support - Management - About Us
... Active Web Hosting, 213 N Stephanie St G318, Henderson, NV 89074 ...
(702) 449-2337