Solution:1
What you need to do is in your jQuery code, pass the data retrieved from the call to the success function like so:
success: function(data){
//Do something
}
That data variable will then contain whatever PHP has echo’d. If you want to access that data in some meaningful way, it will be easiest if you prepare it as an array in PHP i.e. like so:
$dataForjQuery = array('status' => 'OK', 'message' => 'validation passed');
echo(json_encode($dataForjQuery));
this way in jQuery you would do:
success: function(data){
console.log('the status is: ' + data.status); //Will log 'the status is: OK'
console.log('message from server: ' + data.message); //Will log 'message from server: validation passed'
}