Use this :

$comes_from=array(HTTP_VIA
, HTTP_X_COMING_FROM
, HTTP_X_FORWARDED_FOR
, HTTP_X_FORWARDED
, HTTP_COMING_FROM
, HTTP_FORWARDED_FOR
, HTTP_FORWARDED);
// This array *should* hold most of the possible headers identifying the 
remote IP address.
// Credit to [EMAIL PROTECTED] for this list.

foreach ($comes_from as $value) {
if (ereg("^([0-9]{1,3}\.){3,3}[0-9]{1,3}",$$value,$remote_temp)) {
$remote=$remote_temp[0]; // Fish out IP match if ereg returns a value
}}
if (! $remote) {
$remote=$REMOTE_ADDR;
}

Regs,
Neil Smith.


>-----Original Message-----
>From: Tal-ee Roberts [mailto:[EMAIL PROTECTED]]
>Sent: 11 February 2002 15:42
>To: [EMAIL PROTECTED]
>Subject: [PHP-WIN] IP address reference
>
>
>Is there any way to get the user's ip address using PHP?  thanks -Tal-ee


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

Reply via email to