|
Posted by gds on April 14, 2005, 5:48 pm
Please log in for more thread options
show/hide quoted text
<Richard> wrote:
>I am currently using getenv(REMOTE_ADDR) to get the IP address. I don't know
>much about proxies. Is this script giving a more accurate IP?
><?
> if (getenv(HTTP_X_FORWARDED_FOR)) {
> $ipaddress = getenv(HTTP_X_FORWARDED_FOR);
> } else {
> $ipaddress = getenv(REMOTE_ADDR);
> }
As I recall, the X-Forwarded-For header may contain a list of proxies,
some of which may lie within private IP address space. Also, that
header can be easily faked. You need to carefully evaluate how you
are using that information.
--gregbo
gds at best dot com
|