(@) Main | About The World | Web Hosting | Help | Memo | Login | WebMail login
Items like this are CGI programs. CGI stands for "Common Gateway Interface", and what this means is that when a Web page contains a link to a CGI program (either as a clickable link or an inline image) the CGI program runs -- on the Web server -- and the output of that program (a custom-generated Web page or GIF image) is returned to the person looking at it.
In other words, CGIs are programs which run on The World, and can be used to do some tricks with your Web page without requiring your visitors to run JavaScript, Java, ActiveX, Shockwave, Flash, or whatever. The CGI which displays a counter or clock (it's the same program for both) simply sends a GIF of the numbers to the Web browser, so it works with any browser that can display GIFs.
There are several CGI programs that make counters and clocks. The one we use is "Count 2.3", and it's in a file named "Count.cgi". To use it, you would add this tag to your page to make a counter:
<IMG SRC="/cgi-bin/Count.cgi?df=login-name.dat" ALIGN="middle" ALT="counter">(You need to change "login-name" to YOUR OWN login name above!)
Or use this tag to make a clock:
<IMG SRC="/cgi-bin/Count.cgi?display=clock|timezone=GMT-0500" ALIGN="middle" ALT="clock">How does this work? Well, those are perfectly normal <IMG> tags (although they have long lists of options with them, each is a single <IMG> tag much as you'd use with any GIF or JPG.) Here SRC="..." points to a program named "Count.cgi" instead of a GIF file. Count.cgi makes the GIF (which looks like a counter or clock) and sends it to the Web browser.
Because these are <IMG> tags, you can use the same ALIGN="..." or BORDER="..." or ALT="..." options you can use with any other image to control alignment, border, and the "alt text".
In addition, the Count.cgi program has a plethora of options you can set. (Yes, I counted -- not just a bunch of options but a plethora.) Do you see the question mark in SRC="..."? The stuff after the question mark is a list of options we are using to specify what Count.cgi does. In the case of the counter, we are telling it who we are (SRC="/cgi-bin/Count.cgi?df=login-name.dat") so that it can keep our "hit" count separate from everyone else's. (Again, you REALLY SHOULD put your OWN login name there. If you call the data file "data.dat" or "count.dat" it'll get mixed up with someone else's! If you want to have separate counters for each of your pages, you can put other filenames there, but please be sure to include your login name somewhere in that filename.)
In the case of the clock, the somewhat longer list of options (SRC="/cgi-bin/Count.cgi?display=clock|timezone=GMT-0500") specifies that we want a clock (not a counter) and that we're in the Eastern United States time zone ("GMT-0500" is "five hours west of Greenwich Mean Time").
Options for Count.cgi are separated by vertical bars ("|") and you can string together as many as you'd like. For instance, you can change the color of the clock's frame with "frgb=######", where the number is one of those six-digit Web color codes (in hexadecimal):
Red frame:
<IMG SRC="/cgi-bin/Count.cgi?df=login-name.dat|frgb=FF0000">Black frame:
<IMG SRC="/cgi-bin/Count.cgi?df=login-name.dat|frgb=000000">Blue frame:
<IMG SRC="/cgi-bin/Count.cgi?df=login-name.dat|frgb=0066FF">
Other options can specify the color and style of many things:
frgb=###### frame color (six hexadecimal digits) ft=# frame thickness (1 for no frame, 4 is the default) tr=Y make the counter's background transparent instead of black srgb=00FF00|prgb=###### change digits from green (00FF00) to another color (note: this only works with green digit styles "A" and "D") sh=F make the counter invisible instead of showing digits at allFor controlling the digits themselves:
md=# how many digits to display pad=N display "123" (no leading zeroes) pad=Y display "000123" (pad with zeroes) comma=T display "1,234" instead of "1234" dd=A use font style "A" - large green LED digits dd=B use font style "B" - a car's odometer (white digits) dd=C use font style "C" - handwritten white digits dd=D use font style "D" - small green LED digits dd=E use font style "E" - tiny black digits (more digit styles are available, through "Z") incr=F display the counter without changing the numberTo see all 26 digit styles, check out this page:
More examples of Count.cgi on The WorldFor clocks and dates:
display=clock display a clock instead of a counter display=date display a date instead of a counter timezone=GMT-0500 Eastern U.S. time (GMT-0500) or any other time zone tformat=12 display a 12-hour or 24-hour clock tformat=24 dformat=MMDDYY change date format (MMDDYY, DDMMYY, YYMMDD, etc.)And let's not forget:
df=login-name.dat specify who you are for the counter
Here are some examples showing combinations of options. (Some of these lines are very long -- it is important not to put any line breaks in the part of the tag which is in quotes.)
orange frame, white car odometer-style digits on black
<IMG SRC="/cgi-bin/Count.cgi?df=login-name.dat|dd=B|frgb=FF9900">the same without any leading zeroes
<IMG SRC="/cgi-bin/Count.cgi?df=login-name.dat|dd=B|frgb=FF9900|pad=N">the same with lots of leading zeroes
<IMG SRC="/cgi-bin/Count.cgi?df=login-name.dat|dd=B|frgb=FF9900|md=10|pad=Y">change green digits to red, transparent background, no frame
<IMG SRC="/cgi-bin/Count.cgi?df=login-name.dat|dd=A|srgb=00FF00|prgb=FF0000|tr=Y|ft=1">change green digits to purple, huge white frame
<IMG SRC="/cgi-bin/Count.cgi?df=login-name.dat|dd=A|srgb=00FF00|prgb=CC00FF|ft=10|frgb=FFFFFF">invisible counter
<IMG SRC="/cgi-bin/Count.cgi?df=login-name.dat|sh=F">display Greenwich Mean Time
<IMG SRC="/cgi-bin/Count.cgi?display=clock|timezone=GMT+0000">display Boston time, 12 hours (plus AM or PM)
<IMG SRC="/cgi-bin/Count.cgi?display=clock|timezone=GMT-0500|tformat=12">display Boston time, 24 hours (military style)
<IMG SRC="/cgi-bin/Count.cgi?display=clock|timezone=GMT-0500|tformat=24">display date, month-day-year (American style)
<IMG SRC="/cgi-bin/Count.cgi?display=date|dformat=MMYYDD">display date, day-month-year (European style)
<IMG SRC="/cgi-bin/Count.cgi?display=date|dformat=DDMMYY">
I only listed some of the options that are available. To read about the others, see the official documentation below:
Official Count.cgi documentation
(Note that this documentation is for a different version than we have, some features are different.)To see all 26 digit styles, check out this page:
More examples of Count.cgi on The WorldNote: Because this counter is a GIF image, it can only count the number of people who can see GIFs -- so it will miss people using lynx and people who don't wait for images to load. It will also only tell you the approximate number of "hits" for the .html file in which it is placed -- whereas the real Web access log (which you can see with the "wwwacct" command) lists every hit, for every individual image or Web page in your entire site. So the number this counter displays will be much lower than what "wwwacct" says, because "wwwacct" counts all hits to all items everywhere on your site and Count.cgi can only count the number of times people see the Count.cgi GIF.
|
|
Comments? Questions? Problems? Contact us. Page last modified September 5, 2003. Web site contents & design Copyright © 2008 Software Tool & Die. Legal information. | Privacy policy. |
|