Afficher le nom de domaine ou l’adresse IP du serveur

Author:

serveur
Download

<html>
<head>
<title>AdresseIP ou nom de domaine du serveur</title>
</head>
<body>
<div>
<?php
if ( ! empty( $_SERVER['REMOTE_HOST'] ) )
{
  print "Bienvenu sur ".$_SERVER['REMOTE_HOST'];
} else if ( ! empty( $_SERVER['REMOTE_ADDR'] ) ) {
    // Afficher l''adresse
   print "Vous êtes sur ";
   print gethostbyaddr( $_SERVER['REMOTE_ADDR'] );
}
?>
</div>
</body>
</html>

Leave a Reply

Your email address will not be published. Required fields are marked *


+ two = 3