Using gethostbyaddr() to Get a Hostname : Client Info « Development « PHP






Using gethostbyaddr() to Get a Hostname




<html>
<head>
<title>Using gethostbyaddr() to get a host name</title>
</head>
<body>
<?php
if ( isset( $REMOTE_HOST ) )
    print "Visitor at $REMOTE_HOST<br>";
elseif ( isset ( $REMOTE_ADDR ) )
    print "Visitor at ".gethostbyaddr( $REMOTE_ADDR )."<br>";
else
    print "wherever you are<br>";
 ?>
</body>
</html>


           
       








Related examples in the same category

1.Is user using the Miscrosoft Internet Explorer
2. The name and version of the client
3.Http Host
4.Http Referer