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

Logging IP numbers

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #31  
Old 06-16-2004, 06:33 AM
 
Emerson Emerson is offline
 

X-Man
  
Join Date: Mar 2004
Location: Atlanta, GA
Posts: 2,209
 

Default

Thanks B00MER
__________________
Emerson
Total Server Solutions LLC- Quality X-Cart Hosting
Recommended X-Cart Hosting Provider - US and UK servers
Does your host backup your site? We do EVERY HOUR!!!
Shared Hosting | Managed Cloud | Dedicated Servers
Reply With Quote
  #32  
Old 06-16-2004, 07:59 AM
 
cmtrade cmtrade is offline
 

Advanced Member
  
Join Date: Dec 2003
Location: Florida
Posts: 30
 

Default

Thanks boomer, but it's still not working.

I tried adding it where you wrote and it didn't work.
I tried removing the old mod and leave only this one and it still didn't work.

The field in the sql is still empty.

Help please,
Dan.
Reply With Quote
  #33  
Old 06-16-2004, 08:02 AM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

Quote:
Originally Posted by cmtrade
Thanks boomer, but it's still not working.

If you'd like for me to install the mod for you for a small fee please feel free to PM me.

If you've restored the original db_query() in func.php and added this new line above the line I specified all should be well.

Thanks.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #34  
Old 06-16-2004, 03:11 PM
 
NuAlpha NuAlpha is offline
 

X-Adept
  
Join Date: Aug 2003
Location: US
Posts: 598
 

Default

Odd, ours stopped working with 3.5.8 as well even though I updated every line by hand from the diff file for func.php.

For some odd reason, the IP logging mysteriously came back right after I updated our database to handle the room required for recording the IP address, http x forwarded for address, and http client IP address.

Try changing the IP field in the orders table to a larger size. Ours is VARCHAR 128.
__________________
X-Cart Pro 4.5.5 Platinum
X-Payments 1.0.6
PHP 5.3.14
MySQL 5.1.68
Apache 2.2.23
Reply With Quote
  #35  
Old 06-16-2004, 04:45 PM
 
cmtrade cmtrade is offline
 

Advanced Member
  
Join Date: Dec 2003
Location: Florida
Posts: 30
 

Default

Once again, Boomer, I thank you for your curtesy and will to help.
NuAlpha, I thank you too (I tried your version of the logging and it didn't work as well).

I'm not a newbie in php (though I'm not VERY advanced) - I'm modifying things all the time, so I believe I installed the mod correctly.

Here's the code I added:

Code:
# # Insert into orders # db_query("insert into $sql_tbl[orders] (login, total, subtotal, shipping_cost, shippingid, tax, discount, coupon, coupon_discount, date, status, payment_method, flag, details, title, firstname, lastname, company, b_address, b_city, b_state, b_country, b_zipcode, s_address, s_city, s_state, s_country, s_zipcode, phone, fax, email, url, ip) values ('".addslashes($userinfo["login"])."', '$current_order[total_cost]', '$current_order[sub_total]','$current_order[shipping_cost]', '$cart[shippingid]', '$current_order[tax_cost]', '$current_order[discount]', '".addslashes($current_order[coupon])."', '$current_order[coupon_discount]', '".time()."', '$order_status', '".addslashes($payment_method)."', 'N', '".addslashes(text_crypt($order_details))."', '".addslashes($userinfo["title"])."', '".addslashes($userinfo["firstname"])."', '".addslashes($userinfo["lastname"])."', '".addslashes($userinfo["company"])."', '".addslashes($userinfo["b_address"])."', '".addslashes($userinfo["b_city"])."', '".addslashes($userinfo[" b_state"])."', '".addslashes($userinfo["b_country"])."', '".addslashes($userinfo["b_zipcode"])."', '".addslashes($userinfo["s_address"])."', '".addslashes($userinfo["s_city"])."', '".addslashes($userinfo["s_state"])."', '".addslashes($userinfo["s_country"])."', '".addslashes($userinfo["s_zipcode"])."', '".addslashes($userinfo["phone"])."', '".addslashes($userinfo["fax"])."', '$userinfo[email]', '".addslashes($userinfo["url"])."', '$_SERVER[REMOTE_ADDR]')"); $orderid=db_insert_id();

and the second part:

Code:
# # Release previously created lock # func_unlock($LOCK); db_query("UPDATE $sql_tbl[orders] SET ip='$_SERVER[REMOTE_ADDR]' WHERE orderid = '$orderid'"); return $orderids;

Is it correct?

Thanks,
Dan.
Reply With Quote
  #36  
Old 06-16-2004, 04:49 PM
 
NuAlpha NuAlpha is offline
 

X-Adept
  
Join Date: Aug 2003
Location: US
Posts: 598
 

Default

AHHHHH!! I see your problem!

You are using "$_SERVER[REMOTE_ADDR]" which 3.5.8 no longer supports.

You need to use "$HTTP_SERVER_VARS[REMOTE_ADDR]" instead.
__________________
X-Cart Pro 4.5.5 Platinum
X-Payments 1.0.6
PHP 5.3.14
MySQL 5.1.68
Apache 2.2.23
Reply With Quote
  #37  
Old 06-16-2004, 05:34 PM
 
cmtrade cmtrade is offline
 

Advanced Member
  
Join Date: Dec 2003
Location: Florida
Posts: 30
 

Default

I tried it before, and now tried it again - it's not working.
Any other ideas maybe?

Appreciate it,
Dan.
Reply With Quote
  #38  
Old 06-16-2004, 05:58 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

Remove the previous code from the below query, I removed the IP insert since you are doing it after:

Code:
# # Insert into orders # db_query("insert into $sql_tbl[orders] (login, total, subtotal, shipping_cost, shippingid, tax, discount, coupon, coupon_discount, date, status, payment_method, flag, details, title, firstname, lastname, company, b_address, b_city, b_state, b_country, b_zipcode, s_address, s_city, s_state, s_country, s_zipcode, phone, fax, email, url) values ('".addslashes($userinfo["login"])."', '$current_order[total_cost]', '$current_order[sub_total]','$current_order[shipping_cost]', '$cart[shippingid]', '$current_order[tax_cost]', '$current_order[discount]', '".addslashes($current_order[coupon])."', '$current_order[coupon_discount]', '".time()."', '$order_status', '".addslashes($payment_method)."', 'N', '".addslashes(text_crypt($order_details))."', '".addslashes($userinfo["title"])."', '".addslashes($userinfo["firstname"])."', '".addslashes($userinfo["lastname"])."', '".addslashes($userinfo["company"])."', '".addslashes($userinfo["b_address"])."', '".addslashes($userinfo["b_city"])."', '".addslashes($userinfo[" b_state"])."', '".addslashes($userinfo["b_country"])."', '".addslashes($userinfo["b_zipcode"])."', '".addslashes($userinfo["s_address"])."', '".addslashes($userinfo["s_city"])."', '".addslashes($userinfo["s_state"])."', '".addslashes($userinfo["s_country"])."', '".addslashes($userinfo["s_zipcode"])."', '".addslashes($userinfo["phone"])."', '".addslashes($userinfo["fax"])."', '$userinfo[email]', '".addslashes($userinfo["url"])."')"); $orderid=db_insert_id();
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #39  
Old 06-16-2004, 06:03 PM
 
NuAlpha NuAlpha is offline
 

X-Adept
  
Join Date: Aug 2003
Location: US
Posts: 598
 

Default

Quote:
Originally Posted by cmtrade
I tried it before, and now tried it again - it's not working.
Any other ideas maybe?

Appreciate it,
Dan.

Crap! My brain is still burnt out today...5am to 10pm nonstop is hard.

Ahh well, at least I have coffee!
Before coffee -> =P~
After coffee ->
__________________
X-Cart Pro 4.5.5 Platinum
X-Payments 1.0.6
PHP 5.3.14
MySQL 5.1.68
Apache 2.2.23
Reply With Quote
  #40  
Old 06-16-2004, 06:18 PM
 
cmtrade cmtrade is offline
 

Advanced Member
  
Join Date: Dec 2003
Location: Florida
Posts: 30
 

Default

Boomer, I'm sorry I'm wasting u'r time and I REALLY appreciate the help, but the damn thing is not working.

I tried what you wrote (that's why I asked you before if I should use both mods) and it didn't work either.

Is there anything else that could cause the problem? is there something I can do to debug this error, like trying to post another variable that will log the IP? Or try another variable that relates to the server and make sure it transfers the information correctly? Maybe something in the config.php?

I would really like to solve this.

Thanks again,
Dan.
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 06:10 AM.

   

 
X-Cart forums © 2001-2020