Location: PHPKode > projects > Limph > limph-1.9.7/host_add.php
<?php
 /*
   Limph Is Monitoring Pingable Hosts
   Copyright (C) 2005 Jonathan Ciesla
   
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License
   as published by the Free Software Foundation; either version 2
   of the License, or (at your option) any later version.
   
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
  */
require_once("config.php");
require_once("functionlib.php");
session_start();
favicon();

$link = dbms_connect($dbhost, $dbuser, $dbpass, $dbname);

authentication(0,0);

echo "<link rel=stylesheet href=css.php>";
echo "<title>Limph: $sitetitle</title>";
echo "<h3>Limph: $sitetitle</h3>";

echo "<table border=1 align=center>";
echo "<tr><td valign=top>";

//regular section
echo "<table border=1 cellpadding=5 align=center>";
echo "<tr><th>Enter Host Info</th></tr>";
echo "<form action=index.php method=post>";
echo "<tr><td align=right>Name:<input type=text name=name></td></tr>";
echo "<tr><td align=right>IP:<input type=text name=ip>";
echo "<br />Autoupdate(DHCP)<input type=checkbox name=autoupdateip $autouip>";
echo "<br />Leave blank to obtain from DNS</td></tr>";
echo "<tr><td>";
echo "Protocol:  ";
echo "ICMP:<input type=radio name=prot value=icmp checked> UDP:<input type=radio name=prot value=udp> TCP:<input type=radio name=prot value=tcp>";
echo "TCP port:<input type=text size=6 name=port value=0>";
echo "</td></tr>";
echo "<tr><td align=right>Group:<select name=group>";
$query = "SELECT number,name FROM groups ORDER BY name;";
$result = dbms_query($query);
while($line=dbms_fetch_array($result, "NUM")){
  echo "<option value={$line['0']}>{$line['1']}";
 };
echo "</select></td></tr>";
echo "<tr><td align=right>Parent:<select name=parent>";
echo "<option value=\"\">";
$query = "SELECT number,name FROM hosts ORDER BY name;";
$result = dbms_query($query);
while($line=dbms_fetch_array($result, "NUM")){
  echo "<option value={$line['0']}>{$line['1']}";
 };
echo "</select></td></tr>";
echo "<input type=hidden name=addhost value=yes>";
echo "<tr><td align=center><input type=submit value=\"Add Host\"></form></td></tr>";
echo "</table>";
dbms_free_result($result);
dbms_close($link);
//end regular section

echo "</td><td valign=top>";

//portscan iframe
echo "<iframe src=port_scan.php height=400></iframe>";

echo "</td></tr></table>";

echo "<br />";
echo "<form action=index.php method=post>";
echo "<input type=submit value=Back />";
echo "</form>";
?>
Return current item: Limph