hey all, need some help…
I can’t get my unique hit counter to work.
The first file contains 3 functions:
[i]* Get user ip
- Check if user ip is in ip.txt… if not then add the ip to ip.txt and increment the value of count.txt with 1.
- Grab the number from count.txt[/i]
[php]
Then I have two .txt files, ip.txt and count.txt
The IPs are supposed to be stored inside ip.txt while the actual hit count will be stored inside count.txt, (the default value is set to 0).
I’m only interested in logging the IP when someone visits the index page so that’s where I call the function hit_count() which then should check if the IP is inside ip.txt. If not, well then add the IP to that file and then increment the count value with 1.
The last function, get_hits() is used on a another page.
The problem right now is that it works until the first IP has been added… after that it will add +2 to the count.txt for each new IP that visists.
Any ideas?? Help is appreciated