= 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: location.php"); } $location_id = $_GET['location_id']; ?>