Ajax请求发布没有功能

I have got a simple problem but cannot find the error. Maybe you can help. Here is my request:

$http({
    url:'api/create_plane.php',
    method: "POST",
    data: {
        planeKey: $scope.editKey,
        planeSQLID: $scope.editSQLID,
        planeLMID: $scope.editLMID,
        planeAFID: $scope.editAFID,
        planeVersion: $scope.editVersion,
        planeLot: $scope.editLot,
        planeStation: $scope.editStation                   
    },
    dataType: 'json'
}).success(function(data, status, headers, config) {
    console.log(data);
}, function(response) {
    console.log(response);
});

This is my Php file:

$Planes = array();
$MAX_PLANES = 45;

if (empty($_POST['planeLMID'])) {
    for ($i = 1;$i < $MAX_PLANES;$i++) {
        if (checkSQL($i)) {
            $Planes[$i] = new createPlane($i,$db);
        }
    }
    echo json_encode($Planes);   
}
else {
    for ($i = 1;$i < $MAX_PLANES; $i++) {
        if ($Planes[$i]['planeSQLID'] == $_POST['planeSQLID']) {
            echo "HALLO";
        }   
    }
}

However I don't see "Hallo" at any time. I need your help guys.

In create_plane.php file you are trying to use empty $Planes array when $_POST['planeLMID'] is empty.

So you need to fetch $Planes array each time regardless of whether or not you are receiving data by POST. See modified create_plane.php

$Planes = array();
$MAX_PLANES = 45;

for ($i = 1;$i < $MAX_PLANES;$i++) {
    if (checkSQL($i)) {
        $Planes[$i] = new createPlane($i,$db);
    }
}
echo json_encode($Planes);   

if(!empty($_POST['planeLMID'])) {
    for ($i = 1;$i < $MAX_PLANES; $i++) {
        if ($Planes[$i]['planeSQLID'] == $_POST['planeSQLID']) {
            echo "HALLO";
        }   
    }
}