Just a simple function to get someones IP, I know most people have a one liner for this, problem with that I found is sometimes you get invalid and or empty results. My little function aims to work around the common issues that may cause an IP to come back wrong and get it regardless.\r\n\r\nExample your ip is \r\n\r\nCode:\r\n
\r\nfunction getRealIpAddr()\r\n{\r\n	if(!empty($_SERVER['HTTP_CLIENT_IP']))\r\n	{\r\n		$ip=$_SERVER['HTTP_CLIENT_IP'];\r\n	}\r\n	elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))\r\n	{\r\n		$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];\r\n	}\r\n	else\r\n	{\r\n		$ip=$_SERVER['REMOTE_ADDR'];\r\n	}\r\n	return $ip;\r\n}\r\n\r\necho getRealIpAddr();\r\n