I've been trying to get real IP address of the user, and not a proxy address. For that I've done this:
$ip1 = $_SERVER['REMOTE_ADDR']; $ip2 = $_SERVER['HTTP_X_FORWARDED_FOR']; $ip3 = $_SERVER['HTTP_FORWARDED']; mail("email@example.com", "Report", "IP1 is $ip1, IP2 is $ip2, IP3 is $ip3 .");
But when a user is using proxy, the above script gets the proxy address and not the real IP address:
IP is [proxy_addr_here], IP2 is , IP3 is .
Is there any way to get real IP just like whatismyip.com tells (it tells real IP address, proxy address and useragent)?
Update : Whatismyip tells me this
"Your IP Address Is: [my real IP]
Proxy: [my proxy address]
Country: IN –
ISP: Bharti Airtel Ltd."
How come it gathers all the details so accurately but not my PHP script?