here is a piece o fcode that looks up user ip from env vars recursively

<?php
if($HTTP_X_FORWARDED_FOR) 
  { 
   $ip = $HTTP_X_FORWARDED_FOR; 
  }
  elseif($HTTP_VIA)  
  { 
   $ip = $HTTP_VIA; 
  }
  elseif($REMOTE_ADDR) 
  { 
   $ip = $REMOTE_ADDR; 
  } 
  else 
  { 
   $ip = "unknown";
  }
?>

22/01/2002 04:57:50, Jimmy <[EMAIL PROTECTED]> wrote:

>> either $HTTP_SERVER_VARS['REMOTE_ADDR'] or simply $REMOTE_ADDR (if you use
>> $REMOTE_ADDR in functions make sure you do a global on it first) - I
>> personally use $REMOTE_ADDR, but you should read the docs for details...
>
>using $REMOTE_ADDR directly is fine as long as the
>"register_global" setting is off.
>
>otherwise, it's wiser to use getenv('REMOTE_ADDR') instead of
>$REMOTE_ADDR directly.
>
>--
>Jimmy
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>Failure doesn't mean you'll never make it. It just means it may take longer.
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to