I have a questions and I was searching on StackOverFlow, but for some reasons the examples I found didn't work correctly.
I have a following Ajax script (I just sending 2 variables to php file to check if they are in an array):
$.ajax({ url: 'info.php',
data: {'row':row, 'col':col},
type: 'GET',
dataType: 'json',
success: function(){
console.log(row + col);
});
But the thing is that I don't know how to properly send (PHP) data back to "Ajax" and how to capture it:
I have been trying with:
echo json_encode($Result); //Where $Result is a boolean
The data is sent correctly from ajax to .php file, I recieve a status 200 and if I go to .php file I can also see that the data was properly recieved.
I was using information from here: How to get true or false from PHP function using AJAX?
And here: ajax sucess: i can not check if the returned information is true or false
I have tried implementations from both cases. I would appreciate any tips.