if (!empty($_SERVER['HTTP_CLIENT_IP']))
$ip=$_SERVER['HTTP_CLIENT_IP'];
else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
else
$ip=$_SERVER['REMOTE_ADDR'];
?>
Nowadays application development is a matter of dealing with a large number of technologies, libraries, frameworks, etc. You typically
have to put together things such as Hibernate or JPA with LDAP directories, content repositories and with ZK etc.