B.E.C. Networks Limited
Designing electronic and computing solutions

Home

Hit Counter
Home
Products
B.E.C. Hit Counter is a server facility to produce a dynamic GIF image to use for a web page hit counter.  You simply embed the necessary command line into your HTML page, in a standard <IMG> tag.  This sends a request to the server, which will dynamically create a GIF image of the count number.

Count Each Page Separately...

Each HTML web page that the counter exists on is maintained separately by the server.  This means that you can have the same counter code on many of your pages, and monitor the hits separately!!

How it Counts...

Note that each time the graphic is requested, it is incremented.  There is a nocount parameter (see below) which prevents the counter from incrementing (this is what we have used on the examples below, to ensure each counter on this page is the same).

Due to the way web servers will deal with the default page for a web site, BECHitCounter purposely treats site.co.uk and site.co.uk/ the same, as does it also with default.htm, default.html, index.htm and index.html (i.e. these are ignored), so that the counter will count correctly for the default page.

Configure the Counter...

There are a number if parameters that can be provided with the command line (see below), which allow you to tailor the look and feel of the counter, from background colour (including transparent), and the size of the image (in which case the image will be automatically resized to fit your specification).  See the example counters for more ideas.

The HTML tag to put in to your web page, is the standard <IMG> tag, pointing to the virtual GIF file (code shown over multiple lines, for clarity only):

<img src="http://www.becnetworks.kattare.com/servlet/
becnetworks.webapps.bechitcounter.BECHitCounter

with parameters (if used) placed at the end of the line, separating with the ? character (see examples below).

 

Example Counters and HTML code
(for clarity, code shown over multiple lines, and the ?nocount parameter is not shown):
Example 1
<img src="http://www.becnetworks.kattare.com/servlet/
becnetworks.webapps.bechitcounter.BECHitCounter">
Example 2
<img src="http://www.becnetworks.kattare.com/servlet/
becnetworks.webapps.bechitcounter.BECHitCounter?length=15?width=200?height=50">
Example 3
<img src="http://www.becnetworks.kattare.com/servlet/
becnetworks.webapps.bechitcounter.BECHitCounter?fg=ffffff?bg=000000">
Example 4
<img src="http://www.becnetworks.kattare.com/servlet/
becnetworks.webapps.bechitcounter.BECHitCounter?style=bold?fg=0000ff">
Example 5
<img src="http://www.becnetworks.kattare.com/servlet/
becnetworks.webapps.bechitcounter.BECHitCounter?length=0?width=50?height=10">
Example 6
<img src="http://www.becnetworks.kattare.com/servlet/
becnetworks.webapps.bechitcounter.BECHitCounter?width=50?height=10?invisible">
Parameters:
width OPTIONAL - the width of the image to be created, in pixels - the default is 90
height OPTIONAL - the heigt of the image to be created, in pixels - the default is 20
style OPTIONAL - defines if the returned image should use a bold of plain font (specify bold or plain respectively) - the default if plain
length OPTIONAL - the minimum number of digits to use for the image (i.e. padded with zeros) - if the value to display has more digits than length, then this is ignored, to ensure digits are not missed off - the default is 6
bg OPTIONAL - the background colour (in RRGGBB hexadecimal format) for the background of the image - the default is transparent
fg OPTIONAL - the background colour (in RRGGBB hexadecimal format) for the background of the image - the default is black
invisible OPTIONAL - will cause just a transparent graphic to be returned - counting will continue to be recorded, but you will not see the count on the web page
nocount OPTIONAL - causes the counter graphic to be displayed, but does not increment the counter (useful if the you use the counter in more than one place on the web page)

[return to top]