Location: PHPKode > projects > Network Asset Management Archive > nama/newhosts.php
<?php

$fromdate = $_POST['fromdate'];
$iponly = $_POST['IPONLY'];
include "connect.php";
$now = date("j/m/y h:i:s",time());
if ($fromdate == '') {
   $fromdate = date("m/j/y h:i:s",time()-(60*60*24));
}
$stmt = "Select * FROM arp_table where first_seen > '$fromdate' order by ipnum";
print '<body text="#000000" bgcolor="#FFFFCC" link="#0000EE" vlink="#551A8B" alink="#FF0000">';
if ($iponly == 'IP ONLY') {
   $sth = ibase_query($dbh, $stmt);
   while ($row = ibase_fetch_object($sth)) {
       echo  $row->IP_ADDRESS . '<br>';
   }
}
else {
   echo '<table BORDER=3>';
   echo '<tr ALIGN=CENTER BGCOLOR="#999999">';
   echo '<td><b><font face="Times New Roman,Times">IP</font></b></td>';
   echo '<td><b><font face="Times New Roman,Times">MAC</font></b></td>';
   echo '<td><b><font face="Times New Roman,Times">DNS</font></b></td>';
   echo '<td><b><font face="Times New Roman,Times">OS</font></b></td>';
   echo '<td><b><font face="Times New Roman,Times">First Seen</font></b></td>';
   echo '</tr>';
   $sth = ibase_query($dbh, $stmt);
   while ($row = ibase_fetch_object($sth)) {

     echo '<td>' . $row->IP_ADDRESS . '&nbsp</td>';
     echo '<td>' . $row->MAC_ADDRESS . '&nbsp</td>';
     echo '<td>' . $row->DNS_NAME . '&nbsp</td>';
     echo '<td>' . $row->OS . '&nbsp</td>';
     echo '<td>' . $row->FIRST_SEEN . '&nbsp</td>';
     echo '</tr>';
   }
   echo '</table>';
}
?>
Return current item: Network Asset Management Archive