Home > Html, PhP > Get IP address of the visitor , PHP Script

Get IP address of the visitor , PHP Script

October 27th, 2007 Leave a comment Go to comments

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'];
?>

  1. January 10th, 2008 at 11:49 | #1

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

  1. No trackbacks yet.
GoCache - ByREV-Cache v1.0 - live served in : 0.414596 sec (gzip)