Location: PHPKode > projects > Network Asset Management Archive > nama/liaso/postswitches.php
<?php
$now = date("m/j/y h:i:s",time());
include "connect.php";
$SWITCH = $_POST['SWITCH'];
$IP_ADDRESS = $_POST['IP_ADDRESS'];
$DESCRIPTION = $_POST['DESCRIPTION'];
$SNMPSTRING = $_POST['SNMPSTRING'];
$SWITCH1 = $_POST['SWITCH1'];
$IP_ADDRESS1 = $_POST['IP_ADDRESS1'];
$DESCRIPTION1 = $_POST['DESCRIPTION1'];
$SNMPSTRING1 = $_POST['SNMPSTRING1'];
$DELETE = $_POST['DELETE'];
$Submit = $_POST['Submit'];
$serial = $_POST['serial'];

$now = date("j/m/y h:i:s",time());
if ($Submit=='Add Subnet') {
    $stmt = "insert into SWITCHES (IP_ADDRESS, SWITCH, DESCRIPTION, SNMPSTRING, PORT_NUMBER) values ('$IP_ADDRESS1','$SWITCH1','$DESCRIPTION1', '$SNMPSTRING1','$PORT_NUM1');";
    $sth = ibase_query ($dbh,$stmt);
} else {
$i=0;
$ii=count($serial);
for($i=0;$i<$ii;$i++){
   $stmt = "update SWITCHES set SWITCH = '$SWITCH[$i]', IP_ADDRESS = '$IP_ADDRESS[$i]', DESCRIPTION = '$DESCRIPTION[$i]', SNMPSTRING = '$SNMPSTRING[$i]' where serial = '$serial[$i]';"; 
$sth = ibase_query ($dbh,$stmt);
echo $serial[$i] . '<BR>';
}
}
ibase_close($dbh);
?>

Return current item: Network Asset Management Archive