= 2) { // check for submit if ($_SERVER['REQUEST_METHOD']=="POST" ) { $location_id = $_POST['location_id']; $subnet_id = $_POST['subnet_id']; mysql_query("INSERT INTO subnetlocation (location_id, subnet_id) VALUE ('$location_id', '$subnet_id')") or die(mysql_error()); header("Location: subnet.php"); } $subnet_id = $_GET['subnet_id']; ?>