Page 1 of 1

proxy server interfering with IP address

Posted: Mon Apr 10, 2006 8:18 pm
by sheepz
Hi i'm just trying to retrieve an IP address from the user so i have

Code: Select all

<?
$IPaddress = getenv("REMOTE_ADDR");
$ComputerName = gethostbyaddr($_SERVER['REMOTE_ADDR']); 
echo $IPaddress;
echo $ComputerName;
?>
But we use a proxy server setting and every time a user would visit it would display the proxy server's IP "192.168.1.240" address rather than the clients IP address "192.168.1.10" Is there a way around that? Or am I retrieving it wrong?

Posted: Mon Apr 10, 2006 8:53 pm
by timvw
Technically, the proxy makes a connection with your server. That is the only thing you can rely on.

Posted: Tue Apr 11, 2006 11:12 am
by sheepz
so if we're using a proxy there is no code to pickup the address of the actual clients? I'm just making sure I got this right. =)

Posted: Tue Apr 11, 2006 11:45 am
by timvw
From your server POV the proxy is the client.

(Sometimes proxies send a header for which client they are proxying... Other times they don't. I wouldn't rely on them.)

Posted: Tue Apr 11, 2006 12:35 pm
by sheepz
i see, so even if capable it's not reliable enough to use... thx... quick question whats POV?

Posted: Tue Apr 11, 2006 12:46 pm
by Benjamin
Point Of View

Posted: Tue Apr 11, 2006 12:52 pm
by sheepz
ohhh POV hehe thx