Archive

Posts Tagged ‘HTTP_X_FORWARDED_FOR’

Get IP address of the visitor , PHP Script

October 27th, 2007 1 comment
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']; ?>
GoCache - ByREV-Cache v1.0 - live served in : 0.35963 sec (gzip)