Return to Snippet

Revision: 21092
at December 3, 2009 05:12 by ginoplusio


Initial Code
function getIP() {
	$ip="";
	if (getenv("HTTP_CLIENT_IP")) $ip = getenv("HTTP_CLIENT_IP");
		else if(getenv("HTTP_X_FORWARDED_FOR")) $ip = getenv("HTTP_X_FORWARDED_FOR");
		else if(getenv("REMOTE_ADDR")) $ip = getenv("REMOTE_ADDR");
		else $ip = "";
	return $ip;
}

Initial URL
http://www.barattalo.it/2009/12/03/how-many-users-are-connected/

Initial Description
How to get the ip address of the user.

Initial Title
Get IP address in PHP

Initial Tags
ip

Initial Language
PHP