Re: Best way to get the remote IP address?

From: Date: Mon, 21 Jan 2002 20:09:12 +0000
Subject: Re: Best way to get the remote IP address?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-81430@lists.php.net to get a copy of this message
I can't seem to find any references to HTTP_X_FORWARDED_FOR in the PDF PHP documentation from January 2001, so you should probably best stick with either $HTTP_SERVER_VARS['REMOTE_ADDR'] or simply $REMOTE_ADDR (if you use $REMOTE_ADDR in functions make sure you do a global on it first) - I personally use $REMOTE_ADDR, but you should read the docs for details... Bogdan Alan McFarlane wrote: > I'm trying to get the remote IP address of a user in a (PHP) version and > server-software independant way, but am having a few problems. > > Obviously, I've seen $HTTP_SERVER_VARS['REMOTE_ADDR'], but Ive also seen > references to $HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR']. > > Is there any generic solution to this problem (and if so, what is it?) > > Cheers > -- > Alan McFarlane > amcfarlane@bigfoot.com > ICQ: 20787656 > > -- > 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 (#81430) next »