How can I get the Machine IP of visitors of my website logged.
I've used
function getIp(){
$ip = $_SERVER['REMOTE_ADDR'];
if($ip){
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
$ip = $_SERVER['HTTP_CLIENT_IP'];
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
return $ip;
}
BUt what I get is my server IP.
Thanks