Rather than executing a system utility you can just use the built in PHP
functions.

gethostbyaddr() - resolves an IP address into a hostname
gethostbyname() - resolves hostname into an IP address

More information is available in the PHP manual, you can access it online at
http://www.php.net/manual

Jason

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 08, 2002 6:50 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Question


At 08.04.2002  13:00, you wrote:
>
>How to convert or discover from IPadress country visitors on my web ?
>
>roman
You have to make a DNSLOOKUP
If you have a linux box (server setup) you can use
system("nslookup -timeout=3 -retry=1 ".$value)
where $value is the IP-Number. This gives you the
"real" name of the server your client asked from.
the you have to extract the national-code, and got your
country, or org, mil, com

HTH Oliver


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

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

Reply via email to