Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

IP addresses.


ricksteruk2005

Recommended Posts

Ok this has got me stumped now, I have installed a contribution which logs ip address at the account sign up. What i want to do is extend this a little further so that when someone logs in the login.php updates the ip address field in the database,

 

this is the code from my login.php

 

$check_country_query = tep_db_query("select entry_country_id, entry_zone_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$check_customer['customers_id'] . "' and address_book_id = '" . (int)$check_customer['customers_default_address_id'] . "'");

$check_country = tep_db_fetch_array($check_country_query);

 

$customer_id = $check_customer['customers_id'];

$customer_default_address_id = $check_customer['customers_default_address_id'];

$customer_first_name = $check_customer['customers_firstname'];

$customer_country_id = $check_country['entry_country_id'];

$customer_zone_id = $check_country['entry_zone_id'];

tep_session_register('customer_id');

tep_session_register('customer_default_address_id');

tep_session_register('customer_first_name');

tep_session_register('customer_country_id');

tep_session_register('customer_zone_id');

 

tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_of_last_logon = now(), customers_info_number_of_logons = customers_info_number_of_logons+1 where customers_info_id = '" . (int)$customer_id . "'");

$ip = getenv("REMOTE_ADDR") ;

tep_db_query("update ". TABLE_CUSTOMERS . " set customers_ip_address = $ip where customers_info_id = '" . (int)$customer_id . "'");

 

As you can tell its not working. anyone have any suggestions on how to fix this?

I dont help with templates (thats what the seller is for)

 

th search function will often help, when it dont try this in google.

 

site:http://www.oscommerce.com/forums then your search word

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...