Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Display Customer IP during checkout

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #11  
Old 04-14-2006, 12:02 AM
 
anandat anandat is offline
 

X-Adept
  
Join Date: Jan 2004
Posts: 914
 

Default

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.
__________________
X-Cart: 4.7.7 LIVE
Skin:Ultra by xcartmods.co.uk
X-cart Modules: | ACR, Rich Google Search, Customer Testimonials | Cloud Search, | Websitecm: CDSEO (2.1.9)
---------------
Server: Linux
php: 5.3
mysql: 5.0.89
----------------
Reply With Quote
  #12  
Old 04-19-2006, 12:37 PM
 
alru111 alru111 is offline
 

eXpert
  
Join Date: Dec 2005
Posts: 244
 

Default

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());
__________________
X-Cart version 4.0.19
Reply With Quote
  #13  
Old 04-06-2008, 01:53 AM
 
PeterV PeterV is offline
 

Newbie
  
Join Date: Feb 2007
Posts: 8
 

Default Re: Display Customer IP during checkout

This doesn't seem to work, does any genius know how to implement this in 4.1.8 ?
__________________
x-cart gold v 4.1.8
Reply With Quote
  #14  
Old 12-15-2009, 02:06 AM
 
Learner Learner is offline
 

X-Adept
  
Join Date: Dec 2008
Posts: 807
 

Default 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!!!!
__________________
4.6.1 Platinum


Reply With Quote
  #15  
Old 12-15-2009, 06:14 AM
 
exsecror exsecror is offline
 

X-Wizard
  
Join Date: Apr 2007
Posts: 1,284
 

Default 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.
Reply With Quote
  #16  
Old 12-15-2009, 08:23 PM
 
Learner Learner is offline
 

X-Adept
  
Join Date: Dec 2008
Posts: 807
 

Default 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.
__________________
4.6.1 Platinum


Reply With Quote
  #17  
Old 12-18-2009, 11:51 PM
 
Learner Learner is offline
 

X-Adept
  
Join Date: Dec 2008
Posts: 807
 

Default 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...

__________________
4.6.1 Platinum


Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

   

 
X-Cart forums © 2001-2020