Tuesday, December 13, 2011

Check server name, ip address and dns host name using php


<?php
if(isset($_POST['submit']))
{
$SERVER_NAME =$_POST['ip'];
$IP = gethostbyname ($SERVER_NAME);
$server = gethostbyaddr($IP);
echo "<br>Server IP: $IP";
echo "<br>Server Name: $server";



}
 ?>


<form name="" method="post">

<table width="200" border="1">
  <tr>
    <td>IP/Server Name</td>
    <td><input type="text" name="ip"></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><input type="submit" name="submit"></td>
  </tr>
</table>

</form>

No comments:

Post a Comment

Thank you for your Comment....

Popular Posts