this snippet displays the IP address of the user and tries to get the hostname.

unfortunately the built-in PHP function gethostbyaddr() has a very long timeout,

visitor IP” makes use of the built-in PHP functions gethostbyaddr( ).

01 <?php
02 
03 // displays the current reported IP adress of the user
04 echo '
05 <p>
06     your current IP address is '.$_SERVER['REMOTE_ADDR'].'
07 </p>';
08  
09 // tries to find the hostname by looking up the IP - has an evil long timeout though
10 echo '
11 <p>
12     your current hostname (if any) is '.gethostbyaddr($_SERVER['REMOTE_ADDR']).'
13 </p>';
14  
15 ?>