Capturing variable ajax using php

0

I have the following ajax:

$(".select").change(function()
{
  var select = $("#selectAparelho").val(); 
$.ajax({
  async: false,
  type: "POST", 
  url: "administrador.php",
  data: aparelho = select
}).done(function (data) {
  console.log(aparelho);
});
return false;
});

The problem is that when my php server checks to see if the variable is different from null:

if (isset($_POST['aparelho']))

The server verifies that it is null because it has not yet received the value, so it returns that it is null and then does not go through that code snippet to do the verification again. What I need is a way to make the server go back to that location in the code to check if the variable is empty again, at that point it will already be with the value it received from ajax and then it will perform the operation that I want.

    
asked by anonymous 15.12.2016 / 16:45

0 answers