Smallest Text Small Text Medium Text Large Text

Page Counters and Access Counts

People often wish to find out how frequently their web pages get accessed. This information may now be found with this form:


http://www.csulb.edu/cgi-bin/hits


Just type in the URL for the page you wish to check to obtain a count of the number of accesses to that page for the period from when our new webserver was installed (June 17, 1998) up to midnight last night (these counts only get updated once a day).

You may also add an automatic "hits" counter to your web page by including an image tag pointing to our counter script. Usually you'd precede (or surround) this with some explanatory text. For example:



<img src="http://www.csulb.edu/cgi-bin/counter"> users have visited this page.

Generally you'd create the above image tag (<img...>) with your HTML editor's insert-HTML-tag procedure. This brings up a window where you may type in the counter's image tag directly:



<IMG SRC="http://www.csulb.edu/cgi-bin/counter">

The results should look something like this:



users have visited this page

Note that these counts are also only updated once a day, so this won't provide an up-to-the-minute count. If you need that, grab a counter CGI from the Internet. Also, note that the image tag does not specify the size explicitly, but lets the browser obtain it from the source. This is important. If your HTML editor automatically specifies the size based upon a low starting count, there may not be space for expansion as more people visit your site. This is why you should use Insert->HTML Tag in Netscape Composer instead of the insert image button.

A few options are available, and are included as parameters to the counter script. This means that their syntax is somewhat obscure, but not too messy. Each consists of a keyword followed by the "=" sign, and then a value. The three available options are:



bg=colorcode
fg=colorcode
size=sizecode


where "colorcode" is one of those hexadecimal RGB color specifications such as "ff33b6". The "#" sign normally used in the body for hex color codes must be omitted here (or url-encoded). Two sizecodes are available, small and large (medium is the default).

When combining more than one of these options, separate them by an ampersand (&). You'll also need a question mark between "cgi-bin/counter" and the first option. Thus to add a counter with large blue-gray letters on a pink
background use:



Access Counts: <img src="http://www.csulb.edu/cgi-bin/counter?fg=552299&bg=ff77ea&size=large">

to get:

Access Counts: