#39074 [Opn->Fbk]: Problem with getHostByAddr

From: Date: Sat, 07 Oct 2006 09:40:22 +0000
Subject: #39074 [Opn->Fbk]: Problem with getHostByAddr
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-103233@lists.php.net to get a copy of this message
 ID:               39074
 Updated by:       tony2001@php.net
 Reported By:      webmaster at smiliz dot info
-Status:           Open
+Status:           Feedback
 Bug Type:         Unknown/Other Function
 Operating System: Windows XP
 PHP Version:      5.2.0RC5
 New Comment:

Please makre sure you have a reachable working DNS server set up and
give it a try with PHP CLI.


Previous Comments:
------------------------------------------------------------------------

[2006-10-07 09:23:36] webmaster at smiliz dot info

Description:
------------
OS : windows XP
Apache 2.2.3
PHP 5.2 rc5

getHostByAddr not return host and the performance as reduced  !

Reproduce code:
---------------
$fai = @getHostByAddr($_SERVER['REMOTE_ADDR']);
$fai = str_replace(' ','',$fai); 
$fai = strtolower($fai); 
$rep = explode('.', $fai);
if ( $rep[0] == "" ) {
    $reponse = "Inconnu";
}elseif ( $rep[1] == "" ){
 $reponse = ucwords($rep[0]);
}else{
 $reponse =
ucwords($rep[count($rep)-2]).".".strtolower($rep[count($rep)-1]);
}
echo $reponse;


echo var_dump(getHostByAddr($_SERVER['REMOTE_ADDR']));
=> result : string(13) "xxx.xxx.xxx.xxx" 

Expected result:
----------------
wanadoo.fr

Actual result:
--------------
xxx.xxx



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=39074&edit=1


Thread (9 messages)

« previous php.bugs (#103233) next »