I am getting my local IP with this code
if (getenv('HTTP_X_FORWARDED_FOR'))
$ip=getenv('HTTP_X_FORWARDED_FOR');
else
$ip=getenv('REMOTE_ADDR');
I am getting clients default gateway IP but I want client's live IP.
I am getting my local IP with this code
if (getenv('HTTP_X_FORWARDED_FOR'))
$ip=getenv('HTTP_X_FORWARDED_FOR');
else
$ip=getenv('REMOTE_ADDR');
I am getting clients default gateway IP but I want client's live IP.
First comment is right but with some proxy client's IP is available in HTTP_X_FORWARDED_FOR, it seems not to be your case.
Watch other environment variables (phpinfo() or print_r($_SERVER)) to see if your client IP is available.
If not, this is not possible. The proxy is hidding the real IP (as it should be).