July 20, 2008 .
Menu

My Account
Services
 - Internet Accounts
 - Domain Hosting
 - Web Site Utilities
      - Guestbook
      - Mail Form
      - Counter
Help
 - Connecting
 - Email
 - FTP
 - Error Messages
 - Virus Info
 - Spam Assassin
 - Problem Report
FAQs
 - CommunityNet FAQs
 - Connecting FAQs
 - Email FAQs
 - Hosting FAQs
 - Virus FAQs
About Us
 - Mission Statement
 - Policies
 - Board of Directors
 - AGMs
 - Partnerships
Hamilton Links
Bits & Bytes
Web Email
Telnet
Contact Us
Site Map
Home

Partnerships
Trillium Foundation Child Connect
myhamilton.ca
St. Leonard's Society
Hamilton FoodShare
Hamilton Public Library
Web Site Utilities > Counter :: 

Counter

Placing a counter on your Web site allows you to track the number of vistors to your page or pages. The CommunityNet counter is a CGI script already on our server. There are only a couple of steps that you must take to put a counter on your page.

Note:

It is not necessary to have an extensive knowledge of HTML or CGI in order to put a counter on your page, but it helps if you want to know how it works.

This counter will only work on the CommunityNet server.

  1. Server Side Include (SSI) command

    Place the following Server Side Include (SSI) command in your HTML where you want the counter to appear.

    <!--#include virtual="/cgi-bin/hwcncount" -->

  2. Use the CHMOD option in your FTP program.

    In order to execute the SSI, we need to set the file's 'owner execution' permission flag, so that the server will know to look for these commands hidden in the HTML comments.

    In WS-FTP_LE, right click on the name of your web page in the Remote (HWCN side) directory display, and a menu will pop up with chmod (UNIX) listed. Click on that, and you will see a dialog box with permissions checkboxes. Check the box for Execute box under the heading Owner OR change the Numeric value to 744. Click on OK.

You should now see the following on your page.

Lynx Hits: 0, HWCN PPP Hits: 103, Offsite Hits: 2735. 
(click for counter help)6 visitors today, 32 this week, 
99 this month, 2838 since 2003/06/05.6 visitors today, 32 this week, 
99 this month, 2838 since 2003/06/05.

Counter Styles

To change the look of your counter you only need to add additional SSI command(s) ABOVE the initial SSI command of <!--#include virtual="/cgi-bin/hwcncount" -->.

Below are the SSI commands and the style of counter that they produce.

 
The SSI command:

<!--#include virtual="/cgi-bin/hwcncount" -->

Produces the following counter:
Lynx Hits: 0, HWCN PPP Hits: 103, Offsite Hits: 2735. 
(click for counter help)6 visitors today, 32 this week, 
99 this month, 2838 since 2003/06/05.6 visitors today, 32 this week, 
99 this month, 2838 since 2003/06/05.
 
The SSI commands:
<!--#set var="output" value="compact" -->
<!--#include virtual="/cgi-bin/hwcncount" -->
Produces the following counter:
Lynx Hits: 0, HWCN PPP Hits: 103, Offsite Hits: 2735. 
(click for counter help)
6 visitors today, 32 this week, 
99 this month, 2838 since 2003/06/05.
 
The SSI commands:
<!--#set var="output" value="hosted" -->
<!--#include virtual="/cgi-bin/hwcncount" -->
Produces the following counter:
Lynx Hits: 0, HWCN PPP Hits: 103, Offsite Hits: 2735.
6 visitors today, 32 this week, 
99 this month, 2838 since 2003/06/05.6 visitors today, 32 this week, 
99 this month, 2838 since 2003/06/05.
 
The SSI commands:
<!--#set var="output" value="hosted,compact" -->
<!--#include virtual="/cgi-bin/hwcncount" -->
Produces the following counter:
Lynx Hits: 0, HWCN PPP Hits: 103, Offsite Hits: 2735.
6 visitors today, 32 this week, 
99 this month, 2838 since 2003/06/05.
 
The SSI commands:
<!--#set var="output" value="text,all" -->
<!--#include virtual="/cgi-bin/hwcncount" -->
Produces the following counter:
Count on Your CommunityNet!
6 visitors today, 32 this week, 99 this month, 2838 since 2003/06/05
Lynx Hits: 0, HWCN PPP Hits: 103, Offsite Hits: 2735
 
The SSI commands:
<!--#set var="output" value="text,compact" -->
<!--#include virtual="/cgi-bin/hwcncount" -->
Produces the following counter:
Count on HWCN: 2838 visitors since 2003/06/05.
 
The SSI commands:
<!--#set var="output" value="total" -->
You are visitor #
<!--#include virtual="/cgi-bin/hwcncount" -->
to this web page.
Produces the following counter:
You are visitor # 2838 to this web page.
 
Resetting Your Counter

If you decide to reset your counter to 0, or if you wish to start your counter at a specific number, insert the follow command before the initial counter command so that it may look like the following:

<!--#set var="count" value="reset,x,yyyy/mm/dd" -->
<!--#include virtual="/cgi-bin/hwcncount" -->

where x is the number you want the counter at, and yyyy/mm/dd is the date. Upload the page to the server and then refresh it in the browser. The counter should now be reset. Remove the line you just added and upload the page again (If you do not do this last step the counter will continue to reset at the value of x, and will not track the hits to your page).