RE: [PHP] Question
| From: | Non-HP-Boise,ex1) | Date: | Mon, 08 Apr 2002 16:28:02 +0000 |
| Subject: | RE: [PHP] Question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-92081@lists.php.net to get a copy of this message | ||
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: heinisch@creaction.de [mailto:heinisch@creaction.de]
Sent: Monday, April 08, 2002 6:50 AM
To: php-general@lists.php.net
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