Does This IP Locator Work For You?

Status
Not open for further replies.

joshmv

Reformed Berry Slinger
Oct 21, 2007
874
2
0
Kansas
I was looking for a free IP locator to use on one of my LP's, and I thought I found a nice simple one, but the sample on the main page doesn't work for me so I'm hesitant to use it.

Free Dynamic Phrase for Internet IP Address Websites and Visitors - IP2Phrase

Take a look at the purplish box on top and see if it accurately recognizes your city, or at least a city close to you. The city they gave me I've never even heard of.

Also, if you know any other free locators that don't take a coding genius to setup please let me know. Thanks a lot!

Josh
 


Got my country right (Australia) but didn't even bother telling me my city.

Remember that your city is determined by the location of your ISP, not you personally. That will explain some discrepencies.
 
joshmv, the free option from MaxMind is leaps and bounds better then the piece of crap you posted.

Example: I live in Sonoma County, about an hour north of San Francisco, CA - That site you posted puts me in Los Angeles, a full 7-8 hours away.

The free version of MaxMind, GeoLite or whatever its called can put me in Sacramento or Ukiah which are about 1 - 1.5 hours away.

As far as setting up the MaxMind geoip script - If your using PHP of course...

Download the files - put the contents on your site in folder called 'geoip'

In the file where you want to track or show GeoIP information you can put the following in...

Code:
<?php 
include("geoip/geoipcity.inc");
include("geoip/geoipregionvars.php");

$gi = geoip_open("geoip/GeoLiteCity.dat",GEOIP_STANDARD);
$record = geoip_record_by_addr($gi,$_SERVER['REMOTE_ADDR']);

$geo['city'] = $record->city;
$geo['state'] = $GEOIP_REGION_NAME[$record->country_code][$record->region];

geoip_close($gi);
?>
To show the City/State you would use the following code:
Code:
<?php
echo $geoip['city']; // Echos the city
echo $geoip['state']; // echos the state
?>
 
You can always just use the geolocator in Google's AJAX API... you can just copy + paste the javascript, no developer account or key needed, pretty much works on any site.

<script type="text/javascript"
src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
if (typeof(google.loader.ClientLocation.address.city) != null) {
document.write(google.loader.ClientLocation.address.city
+", "
+google.loader.ClientLocation.address.region);
} else {
document.write("Unknown location")
}
</script>
More info + other useful stuff:
Dynamically Generate Users Location On Landing Pages | The Quiet Affiliate
 
Status
Not open for further replies.