ip-geolocation

Get IP geolocation using C# & WPF

 ̄綄美尐妖づ 提交于 2019-12-11 09:49:26
问题 I am doing a module which can display my city, state, latitude and longitude, using IP address of the device I am using. However, I can't get it right. Below, there is my code which I referred to another website: internal GeoLoc GetMyGeoLocation() { try { //create a request to geoiptool.com var request = WebRequest.Create(new Uri("http://geoiptool.com/data.php")) as HttpWebRequest; if (request != null) { //set the request user agent request.UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0;

How to detect a user's language through their IP Address

大憨熊 提交于 2019-12-10 15:14:14
问题 I have developed a website www.tenxian.com. It has three language versions, English, Japanese and Chinese. How can I write an effective PHP program which can automatically choose a language version based on the IP address of the visitor? If I use "if-else", the code would be much complicated; If I use switch-case, how to write it since the data which should be dealt with are IP ranges, not particular numbers. Besides, I don't know these IP ranges What is the easiest way to do it? 回答1: Please,

Geolocate an IP without extensions?

大城市里の小女人 提交于 2019-12-10 12:20:30
问题 Is there a way to locate an IP's country without using any php extensions? I know there are certain extensions, but is this possible without using extensions nor using other websites. For example: www.[ip to country].[something]/?ip=123.123.123.123 回答1: Download a database that maps IP addresses to countries, e.g. from MaxMind, and install it on the server. There is no way to calculate the information stored in the database without accessing remote systems. That's why you really need a

IP to Country - IPv6

家住魔仙堡 提交于 2019-12-10 03:24:13
问题 I've been using an IPv4 to country convertor successfully. eg: get IP of machine and compare to table to get country. I'm updating this currently and with IPv6 around the corner I wanted to ask if there is a solution for converting IPv6 to country? Note: preference for PHP and MySQL thx 回答1: If you're OK with using a web service then my service http://ipinfo.io recently added IPv6 support: $ curl http://ipinfo.io/2001:4860:4860::8888 { "ip": "2001:4860:4860::8888", "hostname": "No Hostname",

curl: (3) Illegal characters found in URL

拈花ヽ惹草 提交于 2019-12-10 02:54:14
问题 I want to bulk lookup ip details at ipinfo.io Here is my code. $ cat ips.txt | xargs -I% curl http://ipinfo.io/%/region The file "ips.txt" contains three ip addresses each on a separate line: (1) 8.8.8.8 (2) 8.8.4.4 (3) 1.2.3.4 This resolves only the last ip address. It should give (1) California (2) Colorado (3) Washington. I get the below: curl: (3) Illegal characters found in URL curl: (3) Illegal characters found in URL Washington If I write ips.txt with only one ip address (for example 8

Country name from an Ip address with free IP geolocation webservice

一世执手 提交于 2019-12-09 07:04:48
问题 First of all thanks to all .... I read that i can use the free IP geolocation webservice to get Country name from an Ip address. But how i get the response to my site , Actually this is what i look , In my site there is a need of displaying the country name from Ip address. Can uou please tell in detail... How can i display the country Name from that site .. 回答1: http://www.maxmind.com/app/php You need to install the php module and then use the following code to get the country name: $country

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

只谈情不闲聊 提交于 2019-12-09 01:09:13
问题 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: 回答1: 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

Solutions for finding website visitor's geolocation

人盡茶涼 提交于 2019-12-08 02:22:21
问题 I am aware that there are many services which provide geolocation tools for working out where users are visiting from. The website I'm working on is an e-commerce site which runs in multi-territories. When a visitor hits the website it should work out where they are from and show the relevant currency/language for the user. In the past we have used maxmind but I'm wondering if there are better solutions out there. I'm calling out to developers with experience in this area to share their

Determining user language based on IP address (geolocation)

℡╲_俬逩灬. 提交于 2019-12-08 02:12:03
问题 I've integrated two pieces of PHP code found on different websites. The first part of code finds out what country you are in and the second one determines the language. I have tried running it but with no luck. It does not give me a error, just a blank white screen. Here is the code: <?php function visitor_country() { $client = @$_SERVER['HTTP_CLIENT_IP']; $forward = @$_SERVER['HTTP_X_FORWARDED_FOR']; $remote = $_SERVER['REMOTE_ADDR']; $result = "Unknown"; if(filter_var($client, FILTER

IP localization: mapping ip->location fixed over time?

倖福魔咒の 提交于 2019-12-07 16:36:23
问题 I'm administering a web platform and want to get some statistical data, where my users come from. I can store the remote IP and I know that there are localization services that map an IP to a geolocation. How is this mapping done? Are there fixed tables, which IP address was given to which region? Must I request the mapping in the moment of the access or can I request it days/months/years later? In other words: Is the mapping from IP to location fixed or does it change over time? 回答1: The