
July 29th, 2002, 06:55 PM
|
|
|
|
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214
Time spent in forums: < 1 sec
Reputation Power: 5
|
|
|
RE: help writing a counter....
1: how/where to start.
make a list of features you want your counter to have. know what you want before you start. from that list, create an order of which feature should be done before the other.
2: how to write the code.
the idea of a counter is to store the value of page visits into a db or txt file, and to alter that number (by adding one) each time the page is viewed. you could easily expand on this idea to have a seperate counter for each page.
3: pitfalls to look out for.
keep in mind that if you're planning to write to a txt file, that it can only be accessed by one request at a time - so it'd probably be a good idea to lock other users out when it's in the middle of a process. counters are pretty straight forward and simple scripts, not a lot to go wrong just make sure your code looks pretty.
|