Getting IP addresses

Hello. I was trying to get IP addresses to block certain people from accessing my site, but it always returns with an IP which is located in Hungary, Budapest everytime. Could anyone help?

Any standard method to find an IP address should work. What method do you use and what IP address do you see?

I’m using php, my code is function getRealIpAddr(){ if (!empty($_SERVER['HTTP_CLIENT_IP'])) //che -, i tried numerous methods but i always get I asked friends, and i tried it too but it’s always that.

Can you also check what the value of each individual header is instead of just using the output of the script?

For example, HTTP_CLIENT_IP could contain the wrong IP but HTTP_X_FORWARDED_FOR could contain the correct one. With this script, you’d always see the wrong IP despite the information being forwarded correctly.

Now it’s returning cloudflare’s ip. I guess i’ll disable it. It doesn’t even work anyways.