= 2) { // check for submit if ($_SERVER['REQUEST_METHOD']=="POST" ) { $location_name = $_POST['location_name']; $parent = $_POST['parent']; mysql_query("INSERT INTO location (location_name, parent) VALUE ('$location_name', '$parent')") or die(mysql_error()); $location_id = mysql_insert_id(); header_location("locationview.php?location_id=" . $location_id); } ?>