geoip

GeoIP and IP to Country in PHP [duplicate]

痴心易碎 提交于 2019-12-10 07:32:50
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How to get the page visitors Country with PHP? I've been searching everywhere, and I can't seem to find anything. I need a free PHP GeoIP/Ip to country. All I can find is that it gives me the country and small form of the country. I also would like to have information of possible street or coords, city, and maybe host information? I need this because I am creating a PHP CMS (for myself and clients) and I want to

htaccess rewrite rules with mod_GeoIP

*爱你&永不变心* 提交于 2019-12-10 00:59:03
问题 I'm having some issues with mod_geoip for an ecommerce site that has 3 different stores. We have our main store at root/store, but also have have stores at root/ukstore and root/austore. The main root/store contains a /skin, /media, and /js directories that contain all css, images, and javascripts. With this current setup, the urls flawlessly swap out the base, but leaves the rest of the URL intact so if a user from the UK goes to root/store/category/product/ they get redirected to root

How to decide user's language

你离开我真会死。 提交于 2019-12-08 07:48:44
问题 I am looking for the best way to decided web user's language so that content can be presented in his native language. I want to know about pros and cons of different techniques. Few options I am looking at are: Using PHP geoIP extension which uses Maxminds database (free version) Accessing user language from browser using http_negotiate_language As I mentioned I don't want to dive deeper about the states and cities. I just want switch content based on users location/language. Do you have any

Getting IPv6 support with php5-geoip and Maxmind database

∥☆過路亽.° 提交于 2019-12-08 07:24:48
问题 I have geoip setup by following these identical steps (http://php.net/manual/en/geoip.setup.php): wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz gunzip GeoLiteCity.dat.gz sudo mkdir -v /usr/share/GeoIP sudo mv -v GeoLiteCity.dat /usr/share/GeoIP/GeoIPCity.dat sudo apt-get install php5-geoip This works brilliantly and has for several years now with IPv4 addresses. I did not, however realize how broken it was with incoming IPv6 devices. For example, it returns Notice

Python/django : Cannot import GeoIP

那年仲夏 提交于 2019-12-08 06:53:00
问题 I cannot import GeoIP in django. I searched and tested this error two days, but still could not know problem. Surely, I installed GeoDjango. I'm on MacOS 10.8 following is log by tested by django shell 1>>from django.contrib.gis import geoip 2>>module 'django.contrib.gis.geoip' from '/Library/Python/2.7/site-packages/django/contrib/gis/geoip/ init .pyc'> it works. even I could find geoip class at Library/Python/2.7/site-packages/django/contrib/gis/geoip/base.py 3>>> from django.contrib.gis

Get a localized name of the users city via Maxmind GeoLite2 Free

怎甘沉沦 提交于 2019-12-08 05:29:57
问题 i want to show the german name of the users city. Is it possible with the free Version of Maxmind Geoip? I did not find a way to open the GeoLite2-City.mmdb or GeoLiteCity.dat, to see which cities are listed, for building my own translation service. How can i open them? 回答1: The GeoIP Legacy database does not include localized names, but the GeoIP2 (or GeoLite2) database does. You may access the localized name as follows: <?php require_once 'vendor/autoload.php'; use GeoIp2\Database\Reader;

How to decide user's language

与世无争的帅哥 提交于 2019-12-07 08:37:21
I am looking for the best way to decided web user's language so that content can be presented in his native language. I want to know about pros and cons of different techniques. Few options I am looking at are: Using PHP geoIP extension which uses Maxminds database (free version) Accessing user language from browser using http_negotiate_language As I mentioned I don't want to dive deeper about the states and cities. I just want switch content based on users location/language. Do you have any other suggestion? Taken from the MicroMVC framework . The following looks for a cookie that could be

Python/django : Cannot import GeoIP

这一生的挚爱 提交于 2019-12-06 16:52:53
I cannot import GeoIP in django. I searched and tested this error two days, but still could not know problem. Surely, I installed GeoDjango. I'm on MacOS 10.8 following is log by tested by django shell 1>>from django.contrib.gis import geoip 2>>module 'django.contrib.gis.geoip' from '/Library/Python/2.7/site-packages/django/contrib/gis/geoip/ init .pyc'> it works. even I could find geoip class at Library/Python/2.7/site-packages/django/contrib/gis/geoip/base.py 3>>> from django.contrib.gis.geoip import geoip Traceback (most recent call last): File "", line 1, in ImportError: cannot import name

Error installing geoip_city gem

☆樱花仙子☆ 提交于 2019-12-06 16:48:29
I keep getting an error when trying to install the geoip_city gem. I've already installed the GeoIP C library to /opt/GeoIP, but the gem doesn't seem to pick it up. I've tried: sudo gem install geoip_city -- --with-geoip-dir=/opt/GeoIP sudo gem install geoip_city -- --with-geoip-lib=/opt/GeoIP/lib sudo gem install geoip_city -- --with-geoip-dir=/opt/GeoIP --with-geoip-lib=/opt/GeoIP/lib all of which output this error: Building native extensions. This could take a while... ERROR: Error installing geoip_city: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework

Rails 4 - How would I automatically detect a user's location and display it on the web app?

孤街醉人 提交于 2019-12-06 07:03:14
I currently have a working app and I would like to have Rails detect a visitor's location by the IP address and display the city and state on the homepage of my website. For example, it would display "Hello {Name} from City, State". Visitors do not have to enter anything. I'm aware of things like GeoIP and Geocode. As far as I know about them, they are used to search for locations from IP or vice versa but they require manually inputting the info. I need it to do it automatically as soon as the user visits my homepage. I have a Post Controller and a home page, and I just want to add some code