[Re: [PHP] user's ip]

From: Date: Tue, 07 Aug 2001 12:02:51 +0000
Subject: [Re: [PHP] user's ip]
Groups: php.general 
Request: Send a blank email to php-general+get-61589@lists.php.net to get a copy of this message
The problem is that REMOTE_ADDR returns the IP address of the proxy (if the user accesses the web-page via a proxy. This will allways return the IP address of the user's machine: if(getenv(HTTP_X_FORWARDED_FOR)) { $ip=getenv(HTTP_X_FORWARDED_FOR); } else { $ip=getenv(REMOTE_ADDR); } $host = gethostbyaddr($ip); Renze Munnik wrote: > On Tue, Aug 07, 2001 at 03:55:25PM +0530, Adrian D'Costa wrote: > > Hi, > > > > I am trying to get the ip address of any user browsing a particular page. > > > > I tried $REMOTE_ADDR but that give me only the remote address. What would > > be the best way? > > > > Adrian > > Okay... Help me out here... > You want to know someones IP-address and using $REMOTE_ADDR you get > the IP-address of the user. What's the problem man?!?!?! > > -- > > * R&zE: > > -- »»»»»»»»»»»»»»»»»»»»»»»» > -- Renze Munnik > -- DataLink BV > -- > -- E: renze@datalink.nl > -- W: +31 23 5326162 > -- F: +31 23 5322144 > -- M: +31 6 21811143 > -- H: +31 23 5516190 > -- > -- Stationsplein 82 > -- 2011 LM HAARLEM > -- > -- http://www.datalink.nl > -- «««««««««««««««««««««««« > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#61589) next »