DEV Community

Discussion on: An easy way to get the (real) client IP in PHP

Collapse
 
arvin profile image
Arvin

Good post Rogerio :)

I also had to unmask the real IP when I started using Cloudflare.
Since my projects were hosted on my own server and it was more than one project, I decided to use mod_remoteip instead of tweaking the code everywhere, and already get the real IP when I’m using $_SERVER[‘REMOTE_ADDR’].

More on this for those who are in the same situation: support.cloudflare.com/hc/en-us/ar...

Collapse
 
rogeriotaques profile image
Rogerio Taques

That’s an awesome solution, Arvin! Thanks for sharing. 🙏👏🤩