Re: [PHP] Geo IP Location help needed...
On Mon, Oct 24, 2011 at 21:07, DealTek wrote: > > Q: Is there some code that can ALWAYS tell the country name of the IP? More often than not, you will get accurate, real-time (as in, not static and potentially stale from a database) results using a direct WHOIS query. If you're on Linux without safe_mode enabled in PHP: The above will work in situations where some copies of a geoIP database may not. An example of this would be recent allocations of the 184 blocks. Plus, if an IP is allocated to an entity in the US, you can get the state to which the IP was registered. Note that, in many cases, this isn't the state in which the IP actually terminates, but in the case of small and local ISPs, academic institutions, et cetera, it's pretty accurate. -- Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re: [PHP] Geo IP Location help needed...
On 25 Oct 2011 at 02:36, DealTek wrote: > On Oct 24, 2011, at 6:23 PM, Bastien wrote: > >> On 2011-10-24, at 9:07 PM, DealTek wrote: >> If the IP is showing, could there be some left over debug in some function? >> >> If the IP is not in your list it could be anything from a new range for a >> region to IP spoofing or some anonymizer or even an old DB > simple code on my part - so no debug stuff... > > $ip = $_SERVER['REMOTE_ADDR']; > $this = geoip_country_name_by_name($ip); > echo 'The country you are in is : '.$this; > ?> > > The tester with the error was a friend on his home dsl and also on his > smartphone (so no IP spoofing from him)... > > but maybe the db is old from - Geo IP Location? hmmm . how do I check? > > the link does not provide any contact info... > http://us3.php.net/manual/en/book.geoip.php You can do a test yourself by hand. Go to www.ripe.net (one of the registries that allocates IP addresses). Click where it says: Ripe database. In the Search field type your IP address. Under Sources click on All. Under Types click on inetnum. Under Flags click on B (shows full details). Then click on Search, and scroll down to look at the results. You need to look at the inetnum object that contains the IP address of interest, then see Country. Be aware that what this tells you is where an IP block is registered. Nothing to stop the entity using it from using those addresses anywhere on the planet, if it has its own network. -- Cheers -- Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Geo IP Location help needed...
On Mon, Oct 24, 2011 at 7:03 PM, Tommy Pham wrote: > On Mon, Oct 24, 2011 at 6:36 PM, DealTek wrote: > > >> >> but maybe the db is old from - Geo IP Location? hmmm . how do I check? >> >> -- >> Thanks, >> Dave - DealTek >> deal...@gmail.com >> [db-11] >> >> >> > Dave, > > I don't Linux too well but it should be similar to FreeBSD in some ways. > You can download the latest updates from Maxmind [1]. See [2] for the info > regarding your current GeoIP DB installed/used on the system. > > Regards, > Tommy > > [1] http://www.maxmind.com/app/php > [2] http://php.net/function.geoip-db-get-all-info > Forgot to include list.
Re: [PHP] Geo IP Location help needed...
On Oct 24, 2011, at 6:23 PM, Bastien wrote: > > On 2011-10-24, at 9:07 PM, DealTek wrote: > > > Dave, > > If the IP is showing, could there be some left over debug in some function? > > If the IP is not in your list it could be anything from a new range for a > region to IP spoofing or some anonymizer or even an old DB > > Bastien Koert > 905-904-0334 Thanks Bastien, simple code on my part - so no debug stuff... The tester with the error was a friend on his home dsl and also on his smartphone (so no IP spoofing from him)... but maybe the db is old from - Geo IP Location? hmmm . how do I check? the link does not provide any contact info... http://us3.php.net/manual/en/book.geoip.php -- Thanks, Dave - DealTek deal...@gmail.com [db-11] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Geo IP Location help needed...
On 2011-10-24, at 9:07 PM, DealTek wrote: > newbie question! > > Hi all, > > So, I had - Geo IP Location - installed for me on my VPS server by a network > tech > > http://us3.php.net/manual/en/book.geoip.php > > > then I used: > > geoip_country_name_by_name(xxx) to display the country by name > > basically works ok - however a few people say that my page: > > 1- will display their remote ip with $_SERVER['REMOTE_ADDR']; > > 2- ! but for some - the country name is blank ! (defeats the whole > purpose) > > - I am not sure how: Geo IP Location actually works... > > Q: Am I correct in assuming that when a country name does NOT show - is it > because that particular IP is NOT seen by Geo IP Location? > > We just installed the latest version (I think) yesterday > > Is it reading from some old outdated database - or > > > > Q: Is there some code that can ALWAYS tell the country name of the IP? > > > > > -- > Thanks, > Dave - DealTek > deal...@gmail.com > [db-11] > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > Dave, If the IP is showing, could there be some left over debug in some function? If the IP is not in your list it could be anything from a new range for a region to IP spoofing or some anonymizer or even an old DB Bastien Koert 905-904-0334 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Geo IP Location help needed...
newbie question! Hi all, So, I had - Geo IP Location - installed for me on my VPS server by a network tech http://us3.php.net/manual/en/book.geoip.php then I used: geoip_country_name_by_name(xxx) to display the country by name basically works ok - however a few people say that my page: 1- will display their remote ip with $_SERVER['REMOTE_ADDR']; 2- ! but for some - the country name is blank ! (defeats the whole purpose) - I am not sure how: Geo IP Location actually works... Q: Am I correct in assuming that when a country name does NOT show - is it because that particular IP is NOT seen by Geo IP Location? We just installed the latest version (I think) yesterday Is it reading from some old outdated database - or Q: Is there some code that can ALWAYS tell the country name of the IP? -- Thanks, Dave - DealTek deal...@gmail.com [db-11] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php