• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 35. CGI and Pre-Processing Fundamentals > Designing for the Real World

Designing for the Real World

Creating a Plain Text Access Counter

Access counters are used to display the number of times your page has been requested and can be displayed by using graphical numbers or simple text numbers. Because a text counter uses plain text, it is much easier to implement than a graphical counter.

Before starting your CGI script, you should spend a moment thinking about what it must do. The script needs access to the current value of the access counter. For this information to be available, you must store it in a text file. Every time your text access counter script is called, it opens the counter file in which the current access count is stored, increments the access count, and saves the new number in the counter file. After the counter value has been incremented, the number is included in the Web page.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint