What Is My IP Address

[insert_php]
$ip= getenv(“REMOTE_ADDR”) ;
echo “

Your IP Address is:

$ip

“;
function visitor_country()
{
$client = @$_SERVER[‘HTTP_CLIENT_IP’];
$forward = @$_SERVER[‘HTTP_X_FORWARDED_FOR’];
$remote = $_SERVER[‘REMOTE_ADDR’];
$result = “Unknown”;
if(filter_var($client, FILTER_VALIDATE_IP))
{
$ip = $client;
}
elseif(filter_var($forward, FILTER_VALIDATE_IP))
{
$ip = $forward;
}
else
{
$ip = $remote;
}

$ip_data = @json_decode(file_get_contents(“http://www.geoplugin.net/json.gp?ip=”.$ip));

if($ip_data && $ip_data->geoplugin_countryName != null)
{
$result = $ip_data->geoplugin_countryName;
}

return $result;
}

echo “

And Its Located In :

“;
echo visitor_country(); // Output Coutry name [Ex: United States]
echo “

“;
[/insert_php]

Do You know what an IP Address is?

According to wikipedia :

An Internet Protocol address (IP address) is a numerical label assigned to each device (e.g., computer, printer) participating in a computer network that uses the Internet Protocol for communication.

An IP address serves two principal functions: host or network interface identification and location addressing.

Its role has been characterized as follows: “A name indicates what we seek. An address indicates where it is. A route indicates how to get there.”

In other words, An IP Address is a number that is used to identify an online device and also the number that the device uses to make communications with their computers. This can be taken as how we get mails into our mail boxes at home. So just like the way home addresses works, You cannot get any thing sent or received without a specific address

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

To Top