RE: Detect users based on country???
I've ran into this issue before and have found the best solution to detecting a county is by asking the customer for it via a modal window. EXAMPLES http://www.xerox.com/ http://www.edmundoptics.com/ I know some people really like using geo-location, but I've found this method to be not always accurate. I've found in the US is usually more accurate than overseas. -Original Message- From: Tony Bentley [mailto:cascadefreehee...@gmail.com] Sent: Monday, November 22, 2010 5:41 PM To: cf-talk Subject: Re: Detect users based on country??? Use a public geo-location service: cfhttp method=get URL=http://ipinfodb.com/ip_query.php?ip=#cgi.REMOTE_ADDR#; result=response / Then use the response XML tree to extract the country or zip: cfset xmmm = xmlparse(response.filecontent) cfset countryname = xmmm.response.countryname.xmltext cfif countryname neq Canada div id=price#price#/div /cfif I wouldn't actually do it in this order because of the lag in http posts. I've had good luck with this method but it isn't perfect because web services can go down and then your checking system breaks. If the location service isn't working, then don't allow anyone to use the module you've built with the integrated geo-location service. Use cookies as you stated to keep from having to do this every time. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339453 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Detect users based on country???
Just a word regarding the ipinfodb geolocation service: The URL for the API has changed, and they now require registration for a free application key that must be included in the request. Go to http://www.ipinfodb.com for info. -- Thanks, Tom Tom McNeer MediumCool http://www.mediumcool.com 1735 Johnson Road NE Atlanta, GA 30306 404.589.0560 ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339455 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Detect users based on country???
I need to hide pricing data on a few web pages for one country, Canada. I've got a range of IP address blocks as in: 41.206.160.0/19 24.36.0.0/16 24.37.0.0/16 24.38.144.0/20 24.57.0.0/16 24.64.0.0/13 24.72.0.0/17 24.72.128.0/20 (the list is much longer). At first I was looking at using .htaccess to detect IP then redirect to a page that plants a cookie for future detection on other pages. Is there a better idea? I'm open to anything. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339439 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Detect users based on country???
Use a public geo-location service: cfhttp method=get URL=http://ipinfodb.com/ip_query.php?ip=#cgi.REMOTE_ADDR#; result=response / Then use the response XML tree to extract the country or zip: cfset xmmm = xmlparse(response.filecontent) cfset countryname = xmmm.response.countryname.xmltext cfif countryname neq Canada div id=price#price#/div /cfif I wouldn't actually do it in this order because of the lag in http posts. I've had good luck with this method but it isn't perfect because web services can go down and then your checking system breaks. If the location service isn't working, then don't allow anyone to use the module you've built with the integrated geo-location service. Use cookies as you stated to keep from having to do this every time. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339440 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm