|
Last update 1999/08/26
The Labs - Design & Functionality For The NetJust Another Web-Counter
- Introduction
- Download
- Usage
- MyDB Detail
| WebCounter1. Introduction
|
This is just another web-counter as a small case-study to implement a simple
counter using MyDBase.
The main difficulty with web-counter which store server side is
locking the counter-file, when you have heavy load it could happen
two counters access (read & write) the same counter-file where
you store the counter, and this may cause reset of the counter or
missing hit. Since most sites have low volume this is often
not considered. This counter certainly works also properly under
heavy load since it uses the client-server way so there is
no locking problem at all.
mywebcount.cgi and
get one of the background GIFs:
50x13
60x16
60x16
60x16
64x20
according your own web-design. If you don't reference any
background GIF the counter appears without it.
|
<img src="mywebcount.cgi?count=name">
|
Add a new user in passwd of MyDBase:
and enter the password in the mywebcount.cgi file.
The counter is implemented with perl using
GD.pm
and
TieMyDB.pm
which makes the entire source quite small.
Using
creates one get and one put for the database.
using
creates one get one put and additional a get when
you check with the mydbd log-files. For that reason, $db{}++
is more economical, despite it's not logical correct, as the
actual counter is 1 more than displayed.

Last update 1999/08/26 
All Rights Reserved - (C) 1997 - 2008 by The Labs.Com |