X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Display Customer IP during checkout (https://forum.x-cart.com/showthread.php?t=12693)

anandat 04-14-2006 12:02 AM

Quote:

Originally Posted by jbart976

Boomer, what do you mean by "And call the variable in any .tpl {$customers_ip}"

I copied the code into config like you said and added the line afterwards, but I'm still not seeing an IP.

Thanks.


That means you will have to put {$customers_ip} in .tpl file where you want to display IP address.

For example if you want to show IP on checkout page then place following code at the end of the file cart_totals.tpl
which is at skin1/customer/main/cart_totals.tpl

Code:

<font color=red>*NOTE*</font> Your IP address : {$customers_ip} is tracked during the checkout process as part of our anti-fraud technology.

alru111 04-19-2006 12:37 PM

Quote:

function fetch_remote_address() {
$_SERVER = $GLOBALS['HTTP_SERVER_VARS'];
# Record basic remote address.
$remote_address = $_SERVER['REMOTE_ADDR'];
# Take proxies into consideration or IPs behind a LAN.
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != 'unknown' && $_SERVER['HTTP_X_FORWARDED_FOR'] != $_SERVER['REMOTE_ADDR']) {
$HXFF_temp = preg_replace('/, ?unknown/i','',$_SERVER['HTTP_X_FORWARDED_FOR']); // Remove any trailing 'unknowns'.
$remote_address .= ','.$HXFF_temp;
}
if (isset($_SERVER['HTTP_CLIENT_IP']) && $_SERVER['HTTP_CLIENT_IP'] != 'unknown' && $_SERVER['HTTP_CLIENT_IP'] != $_SERVER['HTTP_X_FORWARDED_FOR'] && $_SERVER['HTTP_CLIENT_IP'] != $_SERVER['REMOTE_ADDR']) {
$HCI_temp = preg_replace('/, ?unknown/i','',$_SERVER['HTTP_CLIENT_IP']); // Remove any trailing 'unknowns'.
$remote_address .= ','.$HCI_temp;
}
return $remote_address;
#die(fetch_remote_address());
}

Boomer is that the right way to put die(fetch_remote_address());

PeterV 04-06-2008 01:53 AM

Re: Display Customer IP during checkout
 
This doesn't seem to work, does any genius know how to implement this in 4.1.8 ?

Learner 12-15-2009 02:06 AM

Re: Display Customer IP during checkout
 
Quote:

Originally Posted by anandat
That means you will have to put {$customers_ip} in .tpl file where you want to display IP address.

For example if you want to show IP on checkout page then place following code at the end of the file cart_totals.tpl
which is at skin1/customer/main/cart_totals.tpl

Code:

<font color=red>*NOTE*</font> Your IP address : {$customers_ip} is tracked during the checkout process as part of our anti-fraud technology.


Hi anandat is it possible to track Private ip address of a customer for dynamic ip service provider's internet connection?Can you give neat and clean code to do this!!!!

exsecror 12-15-2009 06:14 AM

Re: Display Customer IP during checkout
 
Quote:

Originally Posted by Learner
Hi anandat is it possible to track Private ip address of a customer for dynamic ip service provider's internet connection?Can you give neat and clean code to do this!!!!


No that'd be a violation of the RFC if private addresses were leaked.

Learner 12-15-2009 08:23 PM

Re: Display Customer IP during checkout
 
Quote:

Originally Posted by exsecror
No that'd be a violation of the RFC if private addresses were leaked.


That is true.But I want to place a standalone pc in different shopping malls with dynamic ip broadband connection and want to display my webstore to the customer and sell products online.

Than How can I track those order status with different location with different dynamic ip?

Can you help me how to track those pc's ip address to know the exact location of the order status.

Can anyone help me?

Thanks to all.

Learner 12-18-2009 11:51 PM

Re: Display Customer IP during checkout
 
Quote:

Originally Posted by B00MER
I don't think the default takes Proxies or IP's behind LAN's into consideration. Here's a function that can easily be used in config.php to grab the absolute IP of the user. Thanks to NuLime for the function.
Code:

function fetch_remote_address() {
    $_SERVER = $GLOBALS['HTTP_SERVER_VARS'];
    # Record basic remote address.
    $remote_address = $_SERVER['REMOTE_ADDR'];
    # Take proxies into consideration or IPs behind a LAN.
    if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != 'unknown' && $_SERVER['HTTP_X_FORWARDED_FOR'] != $_SERVER['REMOTE_ADDR']) {
        $HXFF_temp = preg_replace('/, ?unknown/i','',$_SERVER['HTTP_X_FORWARDED_FOR']); // Remove any trailing 'unknowns'.
        $remote_address .= ','.$HXFF_temp;
    }
    if (isset($_SERVER['HTTP_CLIENT_IP']) && $_SERVER['HTTP_CLIENT_IP'] != 'unknown' && $_SERVER['HTTP_CLIENT_IP'] != $_SERVER['HTTP_X_FORWARDED_FOR'] && $_SERVER['HTTP_CLIENT_IP'] != $_SERVER['REMOTE_ADDR']) {
        $HCI_temp = preg_replace('/, ?unknown/i','',$_SERVER['HTTP_CLIENT_IP']); // Remove any trailing 'unknowns'.
        $remote_address .= ','.$HCI_temp;
    }
   
    return $remote_address;
}



Quote:

Originally Posted by anandat
That means you will have to put {$customers_ip} in .tpl file where you want to display IP address.

For example if you want to show IP on checkout page then place following code at the end of the file cart_totals.tpl
which is at skin1/customer/main/cart_totals.tpl

Code:

<font color=red>*NOTE*</font> Your IP address : {$customers_ip} is tracked during the checkout process as part of our anti-fraud technology.



Hi anandat can you help me-

1) what is the exact code for displaying ip address?
2)Can you able to do it successfully ?
3)Is it possible to track customers private ip address from this?

Actually I cannot able to do display the ip address.I want to do this.

Can you help me?

Can anyone help me...



All times are GMT -8. The time now is 01:54 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.