Indiana University


ComputerScience






 Home

 Contacts

 Courses

 Academics

 Careers

 Research

 People

 Calendar

 Resources

 Facilities
   FAQ
   System Notices
   Help
   Hardware
   Software
   Network
   Policies
   CSG Staff
   Lindley Hall

 Hiring

CSG FAQ

Q: How do I include a counter or clock in a web page on the department web server?

The WWW Count CGI package is available on the CS Server. You can get all the details about using this package from the Homepage, including Features, Styles, and Reference Documentation.

You must have a data file on the web server for each unique counter and you will have to specify this filename as an argument to the CGI script. To create such a datafile, run makecounter on any CS Sun in the sharkestra domain. This program will tell you the name of the datafile, which will be of the form USERNAME_N.dat.

Here are some very simple examples, along with the corresponding html snippet, to get you going.

  • Here is a simple hit counter in the default style that counts reloads as hits:

    <img src="/cgi-bin/Count.cgi?df=username_1.dat&reload=T&cache=F&expires=0">

  • Here is a hit counter using the 'cd' style digits with no frame that doesn't count reloads (for a more accurate count of unique hits):



    <img src="/cgi-bin/Count.cgi?df=username_2.dat&reload=F&dd=cd&ft=0">

  • Here is a clock using the default style that will update on a reload:



    <img src="/cgi-bin/Count.cgi?display=clock&pad=F&cache=F&expires=0">
In the examples of counters, you would obviously have to replace username_n.dat with the name of the datafile that was created for you when you ran makecounter.



See an error in this FAQ entry? Please report it.

[Return to the FAQ index]









Valid HTML 4.01!