Try using global $HTTP_SERVER_VARS at the top of your function or using the $_SERVER super global which is automatically global.

Jason

Webmaster wrote:

Hi,

why doesn't this work?

## IP FUNCTIONS ##
function assignClientIP()
{
if (getenv('HTTP_X_FORWARDED_FOR') == '')
{
$this->aCustomer->setClientIP((!empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ) ?
$HTTP_SERVER_VARS['REMOTE_ADDR'] : ( (
!empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] :
$REMOTE_ADDR ));
}

else
{
$this->aCustomer->setClientIP("Proxy");
}
}

The Attribut $clientIP is always empty.





-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to