I'm trying to create a non repeating counter. I am able to log the IP address in one file and in the other file have the number of hits.
Right now I am able to stop counting the reloads. However, if someone else on a different IP address visits my site, and the person who already visited it reloads it, it will count.
I would like to have a whole list of IP address instead of deleting the file and then recreating it during every visit.
So I could have a bunch of IP address in one file eg..
255.255.255.255
123.214.152.102
96.256.32.100
98.25.147.240
and in my other file have the number of hits which would be
4 since there are 4 unique IP addresses.
Now how can I get the script to read all the IP address and create and if statement.
eg..
read the Ip file
$ip = "a list of ip address in the file";
// create some type of array or loop...
// get the current addresss
$addr = getenv("REMOTE_ADDR");
// see if any of them match the current IP address
if ($ip != $addr) {
// log the new IP
// increment the counter
}