Location: PHPKode > projects > Network Asset Management Archive > nama/names.php
<?php
$now = date("m/j/y h:i:s",time());
include "connect.php";

$now = date("j/m/y h:i:s",time());
$stmt = "Select * FROM arp_table where (os starts with 'Win') and (netbios_name ='');";
print '<META HTTP-EQUIV="refresh" CONTENT="900">';
print '<body bgcolor="#FFFFCC">';
echo "<BR>";
$sth = ibase_query($dbh, $stmt);
while ($row = ibase_fetch_object($sth)) {
      $netbios_name="";
      $mydata = "";
      exec("/usr/bin/machinename " . $row->IP_ADDRESS, $netbios_name);
      if (strlen($netbios_name[0])!=0) {
	$mydata = trim($netbios_name[0]);	
        $stmt2 = "update arp_table set netbios_name = '$mydata' where serial = '$row->SERIAL'; ";
        $sth2 = ibase_query ($dbh,$stmt2);
      }
      echo $row->IP_ADDRESS . "--->"  . $mydata . "<BR>";
//      if (strlen($mydata !=0) {
//         $stmt2 = "update arp_table set netbios_name = '$mydata[1]' where serial = '$row->SERIAL'; ";
//         $sth2 = ibase_query ($dbh,$stmt2);
//      }
//      if (strlen($dns_name)!=0) {
//         $stmt3 = "update arp_table set dns_name = '$dns_name' where serial = '$row->SERIAL'; ";
//         $sth3 = ibase_query ($dbh,$stmt3);
//      }
}
ibase_free_result($sth);
ibase_close($dbh);
?>

Return current item: Network Asset Management Archive