in php using ajax catch ajax data in other page code example
Example 1: ajax post example php
var values = $(this).serialize();
$.ajax({
url: "test.php",
type: "post",
data: values ,
success: function (response) {
},
error: function(jqXHR, textStatus, errorThrown) {
console.log(textStatus, errorThrown);
}
});
Example 2: ajax project using php and jquery
<?php
if (isset($_POST['username']) && $_POST['username'] && isset($_POST['password']) && $_POST['password']) {
echo json_encode(array('success' => 1));
} else {
echo json_encode(array('success' => 0));
}