= 2) { // check for submit if ($_SERVER['REQUEST_METHOD']=="POST" ) { $ip = $_POST['ip']; $mac = strip_mac($_POST['mac']); $subnet_id = $_POST['subnet_id']; $asset_id = $_POST['asset_id']; $node_info = $_POST['node_info']; // DNS1 if (!empty($_POST['dns1']) && isset($_POST['dns1suffix'])) { $dns1 = $_POST['dns1'] . $config_dns1suffix; } else { $dns1 = $_POST['dns1']; } // DNS2 if (!empty($_POST['dns2']) && isset($_POST['dns2suffix'])) { $dns2 = $_POST['dns2'] . $config_dns2suffix; } else { $dns2 = $_POST['dns2']; } mysql_query("INSERT INTO node (ip, mac, dns1, dns2, subnet_id, asset_id, node_info) VALUE ('$ip', '$mac', '$dns1', '$dns2', '$subnet_id', '$asset_id', '$node_info')") or die(mysql_error()); header_location("assetview.php?asset_id=" . $asset_id); } $ip = $_GET['ip']; $subnet_id = $_GET['subnet_id']; ?>