Hey. I send the data to PHP using AJAX:

let data = { id: id, search_data: { props: proposals, airports: airports, airlines: airlines, gates: gates_info } }; $.ajax({ url: '/search/start.php', method: 'POST', data: { data: data }, dataType: 'json', }) 

Interestingly, I can access id via $_POST['data']['id'] , but when I try to parse the data from search_data with $_POST['data']['search_data'] I get an error:

Notice: Undefined index: search_data

  • dataType: 'json', ......... your data NOT json - Alexey Shimansky
  • @ Alexey Shimansky, how does the dataType to the fact that PHP cannot parse data ? dataType is the format in which a response from the server is expected. - JamesJGoodwin
  • what you end up doing on the server what? json_decode ....... what are you transmitting? NOT json - Alexey Shimansky
  • Can you add a print_r( $_POST['data'] ) result to the question? - Arnial
  • @Arnial при чем тут json_decode зачем его здесь вызывать. - due to the structure he is trying to send apparently apparently - Alexei Shimansky

0