The javascript could be somthing like this
$.ajax({
type: 'POST',
url: ajaxPage,
data: postContent,
success: function(response) {
//Assume that the php failed
},
error: function() { alert("Ajax request failed."); }
});
Now in the ajax PHP file you could have this
<?php
//Check for validation
if(validation == 'success') {
header('Location: '.FILE_LOCATION);
}
else {
exit('Form submit failed. Please try again');
}
?>
Hope this helps! Metropolis
EDIT SINCE NEW INFO
If you would like to use a json object you could do it like the following
<?php
$response = array('validationStatus' => true);
exit(json_encode($response));
?>
Its not really a big deal if you use json or not, you can still pass a string back either way. I think json is really better for more complicated data that you need to pass back, but theres probably 10 different ways to do this.