Get IP address of the visitor , PHP Script

 

Get IP address of the visitor , PHP Script

get ip funtion in (PHP)

function getIP()
{
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
else if (isset($_SERVER['REMOTE_ADDR'])) $ip = $_SERVER['REMOTE_ADDR'];
else $ip = “UNKNOWN”;
return $ip;
}

This will show the IP address of the visitor the simple way:

< ?php
echo $_SERVER['REMOTE_ADDR'];
?>


One Response to “Get IP address of the visitor , PHP Script”

  1. i am interested on u r site their is a lot of information in u r site and thankfully to u

Post a Comment



We use third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you.