-2
У меня есть простая проблема, но не могу найти ошибку. Может быть, вы можете помочь. Вот мой запрос:Ajax request Сообщение no function
$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);
});
Это мой Php файл:
$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";
}
}
}
Однако я не вижу "Hallo"
в любое время. Мне нужна твоя помощь.
В '' else' случае $ Planes' является __empty__ –
Ну, прежде чем я пришел к пустым плоскостям я получаю эхо JSon закодировать – Kavkus
Вы получаете ваш 'эхо json' в другом запросе –