You ever been to one of those nice hiker biker trails? There is a nice one I visit on the west side of Cincinnati called Miami Whitewater. This park consists of two paths, a shorter 1 mile inner loop, and a longer 8 mile outer loop.
This is our inner loop of our happy path. It is reasonably simple becuase we are just learning beginning our workout. We don't want to pull anything.
We are going to try and create a simple dynamic web page containing some simple text, and a web counter that displays the total number of times that particular page has been viewed. These things used to be all the rage on the web, until businesses started getting investors and the investors wanted to know how come Google got more hits then you did. People that had a lot of traffic already did not need to impress anyone with how many visitors they had, people without much traffic were too embarrassed to show how few hits they were getting.
But even if out of vogue, it makes a perfect little excercise. To pull it off, we need to understand how to create a dynamic page (which you did in the previous section), how to read and write files, how to store and manipulate variables, and how to format HTML output.
Remember we are on the happy path, not the exhaustive path, so we will learn the bare minimum of information about each of these topics necessary to accomplish our goals. We will understand enough to have a reasonable understanding of about what is happening, and learn the details later (if we decide we need to).
Fancy textbooks usually have cool color graphics with lots of arrows and boxes here. These look cool, but I don't find them adding much value, and whenever I draw them I inevitably spend twice as much time putzing around with the graphics editor then I do actually doing the design. If I have to change the design, the graphics are to much hassle to move around, and I make notes on my printout and abandon the original file forever. These diagrams are valuable for impressing managers, but not much else.
Instead, I prefer to make a bulleted or numbered (if you have auto numbering) list of individual steps to be performed, written in precise but normal written english (or whatever your language of choice happens to be). For simple tasks, this can be a straight list. For complicated tasks, this can be an indented outline. HTML does this well, as does Microsoft word. This is very easy to translate to code, very easy to generate and maintain, and keeps you honest about your actual implementation. Boxes, lines, and arrows make it to easy to hand-wave and design yourself into a corner, and too hard to divine the sequence of events.
So lets capture the steps necessary for our web counter. The approach we use may seem awkward at first, but we will see why we have to do it that way when we talk about the stateless nature of web transactions.
There. That should do it. The next few sections explain all the concepts necessary to accomplish the above tasks.