Connecting Tech Pros Worldwide Help | Site Map

Find a Country based on an IP Addr.

  #1  
Old June 16th, 2009, 04:49 PM
Newbie
 
Join Date: May 2009
Posts: 9
Greetings -

I used this code on the link below to trap IP addresses, it worked very nicely.
http://www.scandicweb.com/coldfusion...tutorial45.cfm

Here is a sample output of my report: (note: I removed the real data in purpose)

Tracking_Client_Address: 999.99.99.99
Tracking_Client_Host: www.xyz.com
Tracking_Referrer: http://www.xyz.com/myfeedback.cfm?ID=531
Tracking_Date: 15-Jun-09

Now, I have to manually use the IP@ I trapped and browse google to find its related country. But since I already have the IP saved on my database, I’d like to integrate to search within my Query so I can display the IP as well as its related Country on my report above.

Any assistance as to how to implement the IP search within my code, would be very appreciated.

And if anyone needs help as to what I did to trap IPs, please don’t hesitate to let me know, I’ll be happy to post my code online for your convenience.

Regards,

-AJ
  #2  
Old June 16th, 2009, 06:49 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,517
Provided Answers: 12

re: Find a Country based on an IP Addr.


If you have a website which will return you the country based on the IP, use the cfhttp tag to get the result so that you can display it on the same page.
  #3  
Old June 16th, 2009, 07:06 PM
Newbie
 
Join Date: May 2009
Posts: 9

re: Find a Country based on an IP Addr.


acoder - Thanks for the reply!

My objective is not to display the IP on the same page, but rather, to retrieve a country name based on an IP@. Please note, I do have the IP address saved in my database, but I don't have its country name where it originated from.

Currently, when I receive an IP for a particular user, I manually search its country name on Google, but I'd like to automate the process by displaying the IP and its country code on my Admin page, rather than searching for it MANUALLY on Google.

Thanks again.

-AJ
  #4  
Old June 16th, 2009, 07:16 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,517
Provided Answers: 12

re: Find a Country based on an IP Addr.


There are many sites which offer this service. Find one which gives you permission and then on the admin page, use the cfhttp tag to post the IP, so you can get the result (the country). If the site allows, it will be quite clear what the field name to post is.
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
.Net frameword Resources ( vb.net , asp.net etc...) shamirza answers 0 January 17th, 2007 08:05 AM