We have one internet line shared with multiple users and when everyone access the internet the request are sent through same remote IP. I need to find out the request is coming from which local IP. can anybody please help me to find out the local IP.
I have already written below code but it not giving the excepted result.
Thanks.
$ip = getenv('HTTP_CLIENT_IP');
var_dump($ip);
var_Dump($_SERVER["X-FORWARDED-FOR"]);
if (getenv('HTTP_X_FORWARDED_FOR')) {
$pipaddress = getenv('HTTP_X_FORWARDED_FOR');
$ipaddress = getenv('REMOTE_ADDR');
echo "Your Proxy IP address is : ".$pipaddress. "(via $ipaddress)" ;
} else {
$ipaddress = getenv('REMOTE_ADDR');
echo "Your IP address is : $ipaddress";
}