Return to Snippet

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

Initial Code
function getIP() {
	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

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

Initial Title
Get IP address in PHP

Initial Tags

Initial Language