Table of Contents
 About this Tutor
 Introduction
 HTML Editors
 Basic Code
 Utter Basics
 The Body Tag
 Headings
 The Font Tag
 Images
 Tables
 Tables Part Two
 Tables Part Three
 Nesting Commands
 Some Design Tips
 Meta Tags
 Web Hosts
 Uploading Your Site
 Copyright Issues
 HTML Mail Lists
 Future of HTML
 Marketing
 Style Sheets
 CSS and Text
 CSS and Fonts
 CSS and Cursors
 CSS and Backgrounds
 CGI Scripts
 CGI Counters

 Color Chart One
 Color Safe Chart
 Color Chart Three

 Code Chart

 Arial Character Map
 Times Character Map
 Wing Ding Character Map

 Meta Tag Generator

Counters

There are many, many counters available. Some use graphics to create very "showy" counters. This one is very basis, it simply uses whatever font you tell it to use and prints out the number of hits to date. I like this one because of it's sheer simplicity. I put it at the bottom of almost all my pages.

The use of a counter on your pages gives you an instant way to see how many visitors you are getting. I check the counters weekly and keep a record. This helps me to see how many visitors I'm getting on all my sites, across all of my domains.

The first one uses a line that makes the counter create a count file that is the page name of whatever page you put it into. That is pretty kewel. Here it is:


#!/usr/bin/perl

print "Content-type: text/html\n\n";
($PAGE = $ENV{'DOCUMENT_URI'}) =~ s/\//_/g;
if (!(-e $PAGE)){open(NEW,"> $PAGE");print NEW "0";close(NEW);exit(0); }
open(COUNTER,"+< $PAGE");
flock(COUNTER,2);
$_=;
seek(COUNTER,0,0);
$_++;  print;  print COUNTER;
flock(COUNTER,8);
close(COUNTER);

This one will (in this particular case) create a counter log file named countername. You can see where that is defined within the code. Change countername to anything you want. This is the same exact counter as above, only the one line has changed to where you can name what you want the counter log file to be. For whatever reason, I use this version all the time. I create a new counter.cgi file for each of my pages. For instance, if the page is called I'm working on is called pagetwo.shtml I would name this counter pagetwo.cgi and I'd change the line:

($PAGE = pagetwo);


#!/usr/local/bin/perl

print "Content-type: text/html\n\n";
($PAGE = countername);
if (!(-e $PAGE)){open(NEW,"> $PAGE");print NEW "0";close(NEW);exit(0); }
open(COUNTER,"+< $PAGE");
flock(COUNTER,2);
$_=;
seek(COUNTER,0,0);
$_++;  print;  print COUNTER;
flock(COUNTER,8);
close(COUNTER);

Here is another script for you to use. It's a footer, header, whatever inclusion script. Everytime that you call it out, everything in the file footer.txt displays on the screen. This is very useful. You can change the filename, and the part inside the script that says footer.txt to something else, like, header or whatever you like. It can be anything that you include on numerous pages and want to simplify. The best part is when it comes time to update that text, you do it in one file only. Quick and easy.


#!/usr/bin/perl

$content = "/home/htmlguide/www/cgi-bin/hefo/footer.txt";

print "Content-type: text/html\n\n";

open(FILE,"$content");
while($content = ) {
        print $content;
}
close(FILE);

Here is some sample copy for the footer.txt file


© Copyright 2004 HTMLGuide.US
All Rights Reserved
No Part of this Site May be Reproduced in
Any Form or Any Media Without Prior Written Permission.

Well, we've pretty much covered all the basics, for this Basic HTML Tutorial. There is more to learn, for sure, but the best thing to do is get going writing pages. That alone will bring you more knowledge, and ready you to learn more. There are also more tutorials around that get into programming and more advanced parts of web design and construction. Stick with it. It's a blast. I feel at home running web sites. I hope you will find yourself at home writing them too.




Daily SEO Tips eMail
SEO Blog
SEO Training
SEO Basics 101 eBook
Learn All the Basics to SEO





© Copyright 2003 Night Train Web Productions Night Train Web Productions — All Rights Reserved
No Part of This Work May be Reproduced by any Means Without Prior Written Authorization
8153 / 051006 / 347535