Home > Programming, Servers & Scripts >

Alternatives to Maxmind Geoip Script for foreign countries? (9)


06-14-2012 03:37 AM #1 shishkabob (Member)
Alternatives to Maxmind Geoip Script for foreign countries?

I've noticed from testing some of my landers with VPNs/proxies that the maxmind script works for large European cities, but smaller ones seem to return nothing and just get a blank on the lander.

Are there any available alternatives that are more accurate and will return at least a location close by?


06-14-2012 05:00 AM #2 zeno (Administrator)

The only alternatives I know of are:

http://www.ip2location.com/faqs/db3-...ry-region-city
Which has a pretty decent number of IPs in a lot of countries, don't know whether it's better than MaxMind, but claims 99% country accuracy and large IP database than competitors.

A high level solution would be Neustar - http://www.quova.com/why/target-advertising/


06-14-2012 05:49 AM #3 tijn (Moderator)

Digital Envoy is another but they are not cheap


06-14-2012 07:10 AM #4 zeno (Administrator)

If only one could harness the power of Google somehow, since they most likely have the most comprehensive database on the planet.


07-02-2012 05:21 PM #5 toneko (Member)

hey guys! decided to switch to a paid version instead of maxmind (free) and have recently purchased a database pack from ip2location and guys from the hosting company have placed it in .BIN format into a folder for me. How do I utilize it? The hosting company guy says I need an application for that sending me to this page here: http://www.ip2location.com/developers/php

My skills are just enough to modify some html and css but I never had to deal with any apps or PHP myself. Can anyone advise on what should I do now?

Any help is much appreciated!


07-02-2012 06:14 PM #6 doppelganger (Member)

@toneko

Code:
<?php
require_once('ip2location.class.php');
$ip = new ip2location;
$ip->open('./databases/IP-COUNTRY-SAMPLE.BIN');
$record = $ip->getAll($_SERVER["REMOTE_ADDR"] );
?>
You should be able to use the code shown above.

You will just need to change the path shown in this line to point to the bin file on your server.
Code:
$ip->open('./databases/IP-COUNTRY-SAMPLE.BIN');
You will also need to make this line point to the location of the ip2location.class.php file that you downloaded. If this file is in the same directory as your web page then you can leave it as is.
Code:
require_once('ip2location.class.php');
You could then do something like this on your page:
Code:
Meet single women in <?php echo $record->city ?>
I don't use ip2location personally so I could be missing something here and php is not my strongest language. But, hopefully this gets you going in the right direction. Perhaps someone that actually uses it can offer some better examples.

-Aaron


07-02-2012 07:25 PM #7 toneko (Member)

Thanks a lot Aaron! I'm going to try that out.


07-02-2012 08:13 PM #8 toneko (Member)

ok guys, I created a /databases folder in the same directory where my index.php is and placed a database .BIN file into it. I have also uploaded the ip2location.class.php file into the same directory, then I copy- pasted this code [PHP]<?php
require_once('ip2location.class.php');
$ip = new ip2location;
$ip->open('./databases/IP-COUNTRY-SAMPLE.BIN');
$record = $ip->getAll($_SERVER["REMOTE_ADDR"] );
?>[/PHP] into <body></body> and changed IP-COUNTRY-SAMPLE.BIN to the actual DB filename which is IP-COUNTRY-REGION-CITY.BIN

I created the databases folder in the same directory because previously when I changed the path it unfortunately couldn't find it on the server.

Anyways, doing all the above keeps giving me the following error:

Warning: unpack() [function.unpack]: Type V: not enough input, need 4, have 0
Any ideas? Maybe there is a js solution for it? Many thanks


07-05-2012 08:15 AM #9 toneko (Member)

Ok guys, it appears that I need a developer to utilize my recently purchased ip2location database. Tried a bit of php coding myself- never worked out for me.
The guys from the hosting company said the following:

Basically we can't support your code. We've helped you get the GeoIP php modules loaded on your SERVER and we setup the ip2location database
and the guys from ip2location say:

You will need to have a programming knowledge to query the database using SQL in order to translate the IP address to location. Therefore, you must hire a programmer for this purpose
Can anyone advise someone to get it done for me? I recently switched to VPS RAM512.

Thanks in advance,


Home > Programming, Servers & Scripts >