В вашем скрипте PHP вы можете сделать что-то вроде:
// on this part you decide based on your checks if it's true (or false)
// and what to return as content e.g. based on your authentication checks
$Success = true;
$Content = 'Some HTML';
$Response = array('Success' => $Success, 'Content' => $Content);
echo json_encode($Response);
в JS:
success: function(result)
{
// if true
if (result.Success)
$("#Ajax_response").html(result.Content);
// false (FAIL)
else
$("#Ajax_response").prepend(result.Content);
}
Я надеюсь, что это дает вам представление.