= 2) { // check for submit if ($_SERVER['REQUEST_METHOD']=="POST" ) { $subnet_id = $_POST['subnet_id']; $subnet_address= $_POST['subnet_address']; $subnet_mask = $_POST['subnet_mask']; $vlan_id = $_POST['vlan_id']; $subnet_info = $_POST['subnet_info']; mysql_query("UPDATE subnet SET subnet_address='$subnet_address', subnet_mask='$subnet_mask', vlan_id='$vlan_id', subnet_info='$subnet_info' WHERE subnet_id='$subnet_id'") or die(mysql_error()); header_location("subnetview.php?subnet_id=" . $subnet_id); } $subnet_id = $_GET['subnet_id']; // get current information $result = mysql_query("SELECT subnet_address, subnet_mask, vlan_id, subnet_info FROM subnet WHERE subnet_id='$subnet_id'"); while ($row = mysql_fetch_object($result)) { $subnet_address = $row->subnet_address; $subnet_mask = $row->subnet_mask; $vlan_id = $row->vlan_id; $subnet_info = $row->subnet_info; } ?>