Recently I've needed to change my counter code in my blog site. That is why some attackers manipulate counter numbers of my articles, using a program or anything else.
They can increment the counter to 4000 in a day. So I've changed the counter algorithm. Now I'm using a counter based on IP address. But I have a question about this. I know that $_SERVER['REMOTE_ADDR']
gives us the IP address from which the user is viewing the current page.
I taked this explanation from: http://php.net/manual/en/reserved.variables.server.php. But this command didn't give me users' IP addresses. It always gave me just hosting IP address
. Why?
Could anyone explain this situation, please? Fortunately, I've found a code snippet from the github, and I can use this new counter. (https://gist.github.com/cballou/2201933)
Why just the $_SERVER['REMOTE_ADDR']
doesn't work?