Get IP address of the visitor , PHP Script
October 27th, 2007
1 comment
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'];
?>








