Hit Counter

D

dziner

Guest
A client of mine would like a hit counter on the site I've designed for him. Can anyone suggest and good counters, scripts, or free services? I personally HATE counters, but it's not my site.

Here's the site (The History Channel will be doing an Engineering Disasters episode on this subject on September 1st): www.centraliaminefire.com
 
OP
D

dziner

Guest
witeshark said:

I've already googled it and didn't see anything that seemed very good. I'm looking for someone who has used a hit counter. Doing a web search is the first thing I do. When I don't find anything there I turn to the forums.
 
Joined
Jun 11, 2003
Messages
4,915
Reaction score
68
Points
48
Location
Mount Vernon, WA
Your Mac's Specs
MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2
Just do a simple fopen on a file add 1 to the value inside of it, save it, and go on... it is really easy to write something like that in PHP and if I remember correctly you know PHP pretty well.. So there you go :) You do have to worry about file corruption, due to two people simultaneously accessing the file, but I have a couple of these for a couple of clients and I have not had any problems with it. You could also lock the file if you wanted to, to prevent this from happening.
 
OP
H

h0tk4rl

Guest
Murlyn said:
Just do a simple fopen on a file add 1 to the value inside of it, save it, and go on... it is really easy to write something like that in PHP and if I remember correctly you know PHP pretty well.. So there you go :) You do have to worry about file corruption, due to two people simultaneously accessing the file, but I have a couple of these for a couple of clients and I have not had any problems with it. You could also lock the file if you wanted to, to prevent this from happening.

If you lock the file then you can easily bypass any multiple write issues.

Something simple:
http://www.phpexamples.net/codeExSnippet-54.html
 
Joined
Jun 11, 2003
Messages
4,915
Reaction score
68
Points
48
Location
Mount Vernon, WA
Your Mac's Specs
MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2
Yep exactly what I said :)
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top