ip-geolocation

PHP IF Statment Based On Geo Location?

你说的曾经没有我的故事 提交于 2019-12-01 12:10:20
Is there a way to do a PHP If statement based on the persons location? My problem comes down to Amazon Affiliate links. The link to buy a DVD on Amazon.co.uk is different to the one to buy from Amazon.com and I want a way to only show the correct one. At the same time, If they aren't based in either country, then I don't want the link to show in the first place. Example: If Location = UK; print "amazon-UK-link" If Location = US; print "amazon-US-link" If location = None of the above; print nothing You can use: string geoip_country_code_by_name ( string $hostname ) Example: <?php $country =

PHP IF Statment Based On Geo Location?

和自甴很熟 提交于 2019-12-01 09:43:54
问题 Is there a way to do a PHP If statement based on the persons location? My problem comes down to Amazon Affiliate links. The link to buy a DVD on Amazon.co.uk is different to the one to buy from Amazon.com and I want a way to only show the correct one. At the same time, If they aren't based in either country, then I don't want the link to show in the first place. Example: If Location = UK; print "amazon-UK-link" If Location = US; print "amazon-US-link" If location = None of the above; print

My google app instances does not seem to be on correct region

自作多情 提交于 2019-12-01 00:33:57
I have just created one google app engine application and one 2nd Generation MySQL instance in eu-west2 region. In GCP Console they both seems to be in eu-west2 region. However when I try to gelocate my ip's they seem to be in somewhere in US. What should I do to use GCP in eu-west2 region? my GCP instances: their locations: Google has an extensive world wide network. What you are seeing is us routing you to Google's closest Point of Presence ( POP ), which from that point on you're on a software defined network ( SDN ). What this means is we get your traffic on to our fast network as quickly

Reliable API to determine an ip address's city and country [closed]

送分小仙女□ 提交于 2019-11-29 20:30:39
I want a reliable API that can be used to determine a city and country from an IP address. My search on Google led to http://ipinfodb.com/ip_location_api.php . It seems perfect but my only concern is the reliability of this service. Does google have anything like this? I'm looking for free or paid APIs that help determine location from IP. I've used http://www.hostip.info/ and found it really good. MaxMind has a lite version of their ip2country and ip2city databases: http://www.maxmind.com/app/geolitecity http://www.maxmind.com/app/geolitecountry If you don't mind hosting the database yourself

How to know Geographic location from an IP address

你说的曾经没有我的故事 提交于 2019-11-29 00:43:26
I have created a login application in jsp/servlet in my web project and I want to know about the geographic locations of different users those access my login page. How can I know that a person is accessing my login page from where? For example: If a person is accessing a page from Canada then a record will be inserted into my database such as : IP: 20.4.9.134 and location: Canada. Hans Wassink I use this: http://freegeoip.net/xml/122.169.8.137 Or http://www.geoplugin.net/xml.gp?ip=xx.xx.xx.xx Easy call and it throws you an xml with everything you need to know Edit: New location for geoip

Ip address to country with database [closed]

折月煮酒 提交于 2019-11-28 22:11:17
I have downloaded ip-to-country.csv that has ip ranges that are mapped to countries. How should I store this data to database and how can I query in what range Ip address is to know where Ip address is coming from? Omry Yadan I wrote a small lib called ip2c to do just that. it uses the database from webhosting.info but also supports that from Software77 . It converts the CSV info a compact binary format and can do the search straight on the file, in memory or in a memory mapped file. The Java API usage is similar to this: String ip = 85.64.225.159; int caching1 = IP2Country.NO_CACHE; //

getting users geolocation via html5 and javascript

可紊 提交于 2019-11-28 20:43:25
I am trying to get the users geolocation via the html5 geolcation api, and i use the following snippet for it: if (navigator.geolocation) { var timeoutVal = 10 * 1000 * 1000; navigator.geolocation.getCurrentPosition( displayPosition, displayError, { enableHighAccuracy: true, timeout: timeoutVal, maximumAge: 0 } ); } else { // DO SOME STUFF HERE } function displayPosition(position) { // configuration var myZoom = 12; var myMarkerIsDraggable = true; var myCoordsLenght = 6; var defaultLat = position.coords.latitude; var defaultLng = position.coords.longitude; document.getElementById('latitude')

Reliable API to determine an ip address's city and country [closed]

无人久伴 提交于 2019-11-28 16:06:22
问题 I want a reliable API that can be used to determine a city and country from an IP address. My search on Google led to http://ipinfodb.com/ip_location_api.php. It seems perfect but my only concern is the reliability of this service. Does google have anything like this? I'm looking for free or paid APIs that help determine location from IP. 回答1: I've used http://www.hostip.info/ and found it really good. 回答2: MaxMind has a lite version of their ip2country and ip2city databases: http://www

Best IP to Country Database [closed]

爷,独闯天下 提交于 2019-11-28 15:28:29
We've got a requirement in a couple of our systems to detect a user's country based on their IP address. We'd prefer to use a database rather than a Web Service (to prevent issues with downtime/network access to an externally hosted service) so I'm looking for recommendations, anyone got any good or bad stories of the various IP to Country databases? What I've found from google: Paid Maxmind - $50, then $12 a month, site license IP2Location - $50 a year, single server software77 (Donationware) Free Maxmind Geolite ip2nation Any information on how the free ones compare to the paid ones would be

Exactly how accurate is IP Geolocation?

人盡茶涼 提交于 2019-11-28 09:46:19
I'm setting up a iPhone tracking system for my friends, so they can submit their location to my website by their iPhone, anywhere, anytime - by WiFi or cellular data. The website will use Google Maps for their coordination's so that my other friends can track where they are, however, it is the accuracy of the IP to coordinates to Google Maps is what I'm concerned about, exactly how accurate is it to use Google Maps that would track down the locations by an IP address? I was thinking about 95%, but this was tested in a village which was quite fairly accurate, but what happens if it was in a