In my page I used a functionality of finding Geolocation of a given IP address. This returns result of particular location with zipcode.
But this zipcode is not accurate one. The difference of the zipcodes I got from coding and the real location is about more than 200 miles. I used the following code from ip2location website.
require_once('ip2location.class.php');
$ip = new ip2location;
$ip->open('./databases/IP-COUNTRY-REGION-CITY-LATITUDE-LONGITUDE-ZIPCODE-TIMEZONE-ISP-DOMAIN-NETSPEED-AREACODE-WEATHER-MOBILE-SAMPLE.BIN');
$record = $ip->getAll('50.178.183.243');
echo '<b>IP Address:</b> ' . $record->ipAddress . '<br>';
echo '<b>IP Number:</b> ' . $record->ipNumber . '<br>';
echo '<b>Country Short:</b> ' . $record->countryShort . '<br>';
echo '<b>Country Long:</b> ' . $record->countryLong . '<br>';
echo '<b>Region:</b> ' . $record->region . '<br>';
echo '<b>City:</b> ' . $record->city . '<br>';
echo '<b>ISP/Organisation:</b> ' . $record->isp . '<br>';
echo '<b>Latitude:</b> ' . $record->latitude . '<br>';
echo '<b>Longitude:</b> ' . $record->longitude . '<br>';
echo '<b>Domain:</b> ' . $record->domain . '<br>';
echo '<b>ZIP Code:</b> ' . $record->zipCode . '<br>';
echo '<b>Time Zone:</b> ' . $record->timeZone . '<br>';
echo '<b>Net Speed:</b> ' . $record->netSpeed . '<br>';
echo '<b>IDD Code:</b> ' . $record->iddCode . '<br>';
echo '<b>Area Code:</b> ' . $record->areaCode . '<br>';
echo '<b>Weather Station Code:</b> ' . $record->weatherStationCode . '<br>';
echo '<b>Weather Station Name:</b> ' . $record->areaCode . '<br>';
echo '<b>MCC:</b> ' . $record->mcc . '<br>';
echo '<b>MNC:</b> ' . $record->mnc . '<br>';
echo '<b>Mobile Brand:</b> ' . $record->mobileBrand . '<br>';
?>
I tried the coding in so many websites such as
- http://whatismyipaddress.com/ip-lookup
- http://www.ipinfodb.com
- http://www.fraudlabs.com
- http://www.ip2location.com/
But I didn't get the actual result. Accurate zipcode is not found in the above websites for the give IP address. Anybody can help me to solve this issue. Thanks for reading and solve this issue in advance.