On Sat, 2003-06-14 at 14:38, Tom Ray [Lists] wrote:
> $_SERVER[REMOTE_HOST];
> 
> This will do a reverse lookup on their IP.
> 
> Manual Link:
> http://ca3.php.net/manual/en/reserved.variables.php#reserved.variables.server

Actually, this isn't true. $_SERVER['REMOTE_HOST'] will contain the
hostname of the client if and only if the web server has placed that
value there. Simply referring to the variable does not cause a lookup
to be done.

To do the lookup yourself, use gethostbyaddr():

   http://www.php.net/gethostbyaddr


Hope this clarifies it a bit,

Torben

> Hope it helps
> 
> Tim Thorburn wrote:
> 
> > Hi,
> >
> > I'm setting up a simple tracking program for a website I'm working 
> > on.  Currently it records a visitors IP address, but I would like to 
> > be able to do a DNS lookup of these IP addresses.  Is this possible 
> > with PHP and if so, how is it done?  I've been looking through Google, 
> > and the very few real results I've come across are large perl programs 
> > which make little to no sense to me.
> >
> > Any help would be greatly appreciated.
> >
> > Thanks
> > -Tim


-- 
 Torben Wilson <[EMAIL PROTECTED]>                        +1.604.709.0506
 http://www.thebuttlesschaps.com          http://www.inflatableeye.com
 http://www.hybrid17.com                  http://www.themainonmain.com
 -----==== Boycott Starbucks!  http://www.haidabuckscafe.com ====-----




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

Reply via email to