Matthew Sims wrote:

Hi,
How can I get remote IP adress of client?
I use the fillow script::

$ip=getenv('HTTP_X_FORWARDED_FOR');
if (!$ip)
{
$ip = getenv('REMOTE_ADDR');
}


But sometime it return me "unknown" sa IP adress.

Can someone help me ?

Thanks in advance!


$_SERVER["REMOTE_ADDR"]

Either method will work. You just have to realize that sometimes the IP address is not sent. There is no reliable way to get the clients IP address, so do not depend on it.


--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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



Reply via email to