Re: Client Host Name
| From: | Marcio Endo | Date: | Mon, 07 Aug 2000 05:13:14 +0000 |
| Subject: | Re: Client Host Name | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-10406@lists.php.net to get a copy of this message | ||
> He was asking for the client hostname, not the server's. Generally you
> will have to look up the client hostname from the ip.
>
> ie. echo gethostbyaddr($REMOTE_ADDR);
That did the trick, thanks!
I just added a "@" prefix, so the function won't give any warning messages
when it can't find the hostname:
echo @gethostbyaddr($REMOTE_ADDR);
But as Duncan Hill pointed out: "DNS tends to be a blocking connect call.."
Marcio Endo
Computer Engineering - ITA - Brazil