Home > PHP > Get IP And Location using PHP

Get IP And Location using PHP

April 22nd, 2010

<?php

$ip=$_SERVER['REMOTE_ADDR'];

echo “<font face=’Verdana’ size=’3′><b>IP Address= $ip</b>”;

$url = “http://www.ipmango.com/api.php?ip=”.$ip; $xml = simplexml_load_file($url);

echo “City : {$xml->city} <br />”;

echo “Region : {$xml->region} <br />”;

echo “Country Name : {$xml->countryname} <br />”;

echo “Latitude : {$xml->latitude} <br />”;

echo “Longitude : {$xml->longitude} <br />”;

?>

Refer: http://www.shefeekj.com/get-ip-and-location-using-php.html

Author: garima Categories: PHP Tags:
  1. No comments yet.
  1. No trackbacks yet.
Site is Under Construction