Re: $_SERVER[REMOTE_ADDR]

From: Date: Wed, 02 Apr 2003 08:48:27 +0000
Subject: Re: $_SERVER[REMOTE_ADDR]
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-141944@lists.php.net to get a copy of this message
Try these: function getIP() { if (getenv('HTTP_CLIENT_IP')) $ip=getenv('HTTP_CLIENT_IP'); else if ( getenv('REMOTE_ADDR') ) $ip=getenv('REMOTE_ADDR'); else $ip = 'unknown'; return trim($ip); } function getISP($addr,$byIP=true) { /* Can pass in an ip, like 64.xxx.xxx.xx or a domain, like www.aeontrek.com; true if it is an IP; else false */ if ( $byIP ) return trim(gethostbyaddr( trim($addr) )); else return trim(gethostbyname ( trim($addr) )); } -- Nicole "John" <johntamares@yahoo.com> wrote in message news:20030402062415.1279.qmail@pb1.pair.com... > Makes me think...... what exactly the $_SERVER[REMOTE_ADDR] is doing....???? > > Cause it does not really show the actual IP address instead IP address > within its range.... > > e.g. 66.87.25.122 > output 66.87.25.2 > > any idea how to get their actual IP add and if possible the name of their > computer.... > > Also, is it also possible to get or trace the IP add? > > many thanks, > John > >

« previous php.general (#141944) next »