Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
added 552 characters in body
Source Link
Kanika
  • 171
  • 2
  • 15

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.

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.

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.

Source Link
Kanika
  • 171
  • 2
  • 15

Magento showing wrong customer ip

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.