note 90074 deleted from function.gethostbyaddr by danbrown
| From: | danbrown@php.net | Date: | Sun, 05 Apr 2009 02:24:54 +0000 |
| Subject: | note 90074 deleted from function.gethostbyaddr by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-152823@lists.php.net to get a copy of this message | ||
Note Submitter: anonymous
----
to respond to the anonymous post bellow (see -> http://fr.php.net/manual/fr/function.gethostbyaddr.php#88920)
stock addr is only usefull on an admin interface it's right but maybe for tests can you use a
function like this to stop it, or if we have a so rare but existing stolen ip:
function test_addr($Vip) {
$addr = gethostbyaddr($Vip);
return $addr;
}
$start_addr = microtime();
$addr = empty(test($Vip)) && microtime()-$start_addr > '500' ? '' :
gethostbyaddr($Vip);
$user_addr = empty($addr) ? 'unknown' :
substr($addr,strlen($Vip)+'1',strlen($addr));
in any case stock it can be usefull in the future...