| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Logging IP numbers | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Logging IP numbers
Today I realized that X-cart doesn't log IPs at orders and registrations.
It would help to take out fake users and fake orders - made intentionally, especialy with the different payment options. It would also help with frauds. Is this just my wish? |
|||||||
#2
|
|||||||||
|
|||||||||
Not too much trouble but...
First we alter the xcart_orders table and add a new field named 'ip'. I did this with phpMyAdmin. Simply copy paste the code snippet into the SQL query box. Code:
Next we open include/func.php, locate the func_place_order(); function, in my 3.2.2pro code its on line 1017. Code:
Replace the db_query(); with this one. Note the $_SERVER[REMOTE_ADDR] at the end of the query storing the users remote IP. Now we want to be able to see the order data in the admin. Edit [skin1]/main/order_info.tpl add the following where ever you want the IP of the order displayed, I put mine under the email. Code:
Good luck! Please make a donation if you find this useful.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart. |
|||||||||
#3
|
|||||||
|
|||||||
Actually I did that myself before I posted this topic,
but I thought it would be nice if this code would be included in standard release - since it is very important tool in fight against frauds. But thank you for the quick response, now I know to who I'll turn when I'll have problems
__________________
X-cart version 4.1.7 Apache/2.0.52 (CentOS) My SQL 5.0.58 PHP Version 5.1.6 |
|||||||
#4
|
|||||||
|
|||||||
Just one question, why would you define ip as varchar(64)?
As system is now, you need 4*3 places + 3 dots = 15 places max?
__________________
X-cart version 4.1.7 Apache/2.0.52 (CentOS) My SQL 5.0.58 PHP Version 5.1.6 |
|||||||
#5
|
|||||||
|
|||||||
Since Boomer posted some code, I think I should too..
To add IP's to customer registration, customer changing profile, and adding to newsletter from profile do following. In SQL enter Code:
Then open INCLUDE/REGISTER.PHP and change (in red) on line 112 Code:
on line 122 Code:
on line 155 Code:
For displaying IP in customer profile, you can add following in MAIN/REGISTER.TPL Code:
I'll post code for capturing IP from 'Newsletter signup box' later.[/code]
__________________
X-cart version 4.1.7 Apache/2.0.52 (CentOS) My SQL 5.0.58 PHP Version 5.1.6 |
|||||||
#6
|
|||||||
|
|||||||
Hi,
Could someone please tell me if it is possible to take the IP address of the clients who register, do a WHOIS lookup, and then store the country in which their ISP is located into an X-Cart field? thanks, Eric G. |
|||||||
#8
|
|||||||
|
|||||||
That would only work if they had a top-level domain name as their IP, which would be virutally no one. You can't do a WHOIS lookup for a regular IP.. a traceroute would be more the way to go.
__________________
Joshua Sowin ...taking things one TPL at a time. |
|||||||
#9
|
|||||||
|
|||||||
Detection of geographical location of a user by the IP number of their ISP connection is now possible.
Have a look at www.geobytes.com Have a look at the Flash animation. The the possibilities are amazing!! Regards, Eric. |
|||||||
#10
|
|||||||
|
|||||||
Yes, it's been available for a long time... but a WHOIS won't do it
I've used http://visualroute.visualware.com for years.
__________________
Joshua Sowin ...taking things one TPL at a time. |
|||||||
|
|||
X-Cart forums © 2001-2020
|