| cgi scripts | ||||||||||
Keeping a count of your visitors This page is here to tell you how to use web counters on your free Wave Rider Web page. Its easy, and if you use these counters, much faster than using remote count URLs (like http://www.webcount.com). So first - what is a web counter? A counter gives you a graphical display of how many people have visited your web page. Your counter can have a varity of digit styles, colours, borders - and this page is here to try and explain how to use them. Contents
A counter is a graphic, just like any other. So, to insert one in a web page, you use the <IMG SRC="xxxx"> tag, just like embedding a GIF or JPEG file in your page. However, the source for the image is actually a CGI script - a program - which runs on our web server. Don't worry if you don't know what a CGI script is, you don't have to. So to add a basic counter on your page, you would use the tag <IMG SRC="/cgi-bin/Count.cgi?df=username.dat"> where username is your user name (the bit in your email address before the @). This would produce the following OK, things to remember at this point. First, the slashes must be forward slashes. The Count.cgi MUST have a capital C, and you must remember the quotation marks. If your counter doesn't work, check these first. Now, I know what you're thinking - it works but it looks untidy, because it doesn't line up with the text properly. You can can cure this by using an ALIGN=absmiddle in the img tag. In other words, our tag now becomes <IMG SRC="/cgi-bin/Count.cgi?df=username.dat" align=absmiddle> Which produces the following counter : Getting a bit clever with counters Frames If you look at the counters above, you'll see that they all have an ornamental border around them. We can alter this so that it is thicker, thinner, etc. etc. We do this by adding the parameter ft=number between the ? and the & in the CGI call. Sounds complicated - not really - look at these
Frame Colours OK, I knew it wouldn't be long before someone asked this question - how do I change the frame colour? Its almost the same as changing colours with Netscape, again, add a parameter frgb=ff;ff;ff; in the call. The ff;ff;ff is an RGB colour code. So for a black frame, you would use, <IMG src="/cgi-bin/Count.cgi?frgb=0;0;0;&ft=5&df=cpage.dat" align=absmiddle>. The good news is that you can also use names of colours - which will return the correct code to use instead (but obviously you have to take the scripts best guess at each colour. So we could also have used <IMG src="/cgi-bin/Count.cgi?frgb=black&ft=5&df=cpage.dat" align=absmiddle> which would show us on the page - use frgb=0;0;0 instead. Some examples:
Digit Styles Well, these green digits are starting to get tedious aren't they. So, we have a variety of styles for you to try. You specify the style by including a dd=style parameter as before. So for style A, which is the one we've been using so
far, you would specify <IMG src="/cgi-bin/Count.cgi?dd=A&df=username.dat"
align=absmiddle> and we'd get this The following table shows all the different styles you can use, and their names.
What if I already have a counter, and I don't want to loose the hits I've already taken? Easy. Just add the parameter st=xxxx (where xxxx is the number you want the counter to start from), and things will resume as normal. For example, <IMG src="/cgi-bin/Count.cgi?st=200&df=username.dat" align=absmiddle>. |