Mega Code Archive

 
Categories / Php / Development
 

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>