1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
function get_ip() { $ipaddr = "Unknown"; if ($HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"]) { $ipaddr = $HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"]; } elseif ($HTTP_SERVER_VARS["HTTP_CLIENT_IP"]) { $ipaddr = $HTTP_SERVER_VARS["HTTP_CLIENT_IP"]; } elseif ($HTTP_SERVER_VARS["REMOTE_ADDR"]) { $ipaddr = $HTTP_SERVER_VARS["REMOTE_ADDR"]; } elseif (getenv("HTTP_X_FORWARDED_FOR")) { $ipaddr = getenv("HTTP_X_FORWARDED_FOR"); } elseif (getenv("HTTP_CLIENT_IP")) { $ipaddr = getenv("HTTP_CLIENT_IP"); } elseif (getenv("REMOTE_ADDR")) { $ipaddr = getenv("REMOTE_ADDR"); } return $ipaddr; } |
Tag: ip
Proudly powered by WordPress.
Theme: Flat 1.5.1 by YoArts.