If your request is going through a proxy, $_SERVER["REMOTE_ADDR"] will
contain the ip address for the proxy. The proxy might add a
HTTP_X_FORWARDED_FOR header to the request which will contain the ip address
of the client to the proxy, which should be where the request originated. It
is possible for a request to travel through several proxies and then the
HTTP_X_FORWARDED_FOR header will be added several times.

$_SERVER['HTTP_X_FORWARDED_FOR'] if exists will contain the ip address of
where the request originated if the request was proxied.
$_SERVER['HTTP_X_FORWARDED_FOR'] may be an array if the request was proxied
several times.

Regards,

Peter Albertsson

-----Original Message-----
From: ascll [mailto:[EMAIL PROTECTED] 
Sent: den 30 mars 2004 03:13
To: [EMAIL PROTECTED]
Subject: [PHP] Wrong IP address

Greetings,

I make use of these: -

<?php
echo($_SERVER["REMOTE_ADDR"]);
?>

to get the web IP address for my machine once my PC is connected to
Internet..

Anyway, sometime I get the correct IP address, but sometime NOT.

Does anyone know why?

Thanks in advance.

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

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

Reply via email to