PHP & Proxy Servers

The PHP _SERVER variable contains the IP of the remote client.

$ip = $_SERVER['REMOTE_ADDR']


REMOTE_ADDR
You may be tempted to decide your clients IP by using REMOTE_ADDR but this will be the IP of any reverse proxy server if one is being used
[REMOTE_ADDR] => 10.10.10.30


HTTP_X_FORWARDED_FOR
Instead use HTTP_X_FORWARDED_FOR which is a list of IPs and (normal) proxy servers your client used to reach your site
[HTTP_X_FORWARDED_FOR] => 10.10.10.10, 10.10.10.20
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki