I have a US based website when customer placed order, in their order "Placed from IP" showing my ip in each order also, I have few custom module for tracking order and user activity in these modules ip is showing mine. it's strange.I am not found the issue.Also when i'm printing ip from root folder then it's working fine.
My module code :
function getUserIP()
{
$client = @$_SERVER['HTTP_CLIENT_IP'];
$forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
$remote = $_SERVER['REMOTE_ADDR'];
if(filter_var($client, FILTER_VALIDATE_IP))
{
$ip = $client;
}
elseif(filter_var($forward, FILTER_VALIDATE_IP))
{
$ip = $forward;
}
else
{
$ip = $remote;
}
return $ip;
}
But my concern is Magento default sales/order
code should be run fine.