How to get the client IP address in PHP
Whatever you do, make sure not to trust data sent from the client. $_SERVER[‘REMOTE_ADDR’] contains the real IP address of the connecting party. That is the most reliable value you can find. However, they can be behind a proxy server in which case the proxy may have set the $_SERVER[‘HTTP_X_FORWARDED_FOR’], but this value is easily spoofed. For example, … Read more