= 2) { // check for submit if ($_SERVER['REQUEST_METHOD']=="POST" ) { $node_id = $_POST['node_id']; $subnet_id = $_POST['subnet_id']; $mac = strip_mac($_POST['mac']); $dns1 = $_POST['dns1']; $dns2 = $_POST['dns2']; $node_info = $_POST['node_info']; mysql_query("UPDATE node SET subnet_id='$subnet_id', mac='$mac', dns1='$dns1', dns2='$dns2', node_info='$node_info' WHERE node_id='$node_id'") or die(mysql_error()); header_location("nodeview.php?node_id=" . $node_id); } $node_id = $_GET['node_id']; // get node info $result = mysql_query("SELECT a.asset_name, n.ip, n.mac, n.dns1, n.dns2, n.subnet_id, n.node_info FROM asset a, node n WHERE node_id='$node_id' AND a.asset_id=n.asset_id"); while ($row = mysql_fetch_object($result)) { $ip = $row->ip; $subnet_id = $row->subnet_id; $mac = $row->mac; $dns1 = $row->dns1; $dns2 = $row->dns2; $node_info = $row->node_info; $asset_name = $row->asset_name; } ?>