Very good I have a problem to redirect from use ajax post request
The problems are as follows:
I have a div which receives only all the validation texts that could occur in the application
<div id="resultado">
</div>
and I have my ajax application
$(function(){
$("#btn_entrar").click(function(){
var url = "clases/loginclass.php";
$.ajax({
type:"POST",
url: url,
data: $("#frm_login").serialize(),
success: function(data){
if(data.redirect){
window.location.href = data.redirect;
}else {
$("#resultado").html(data);
}
}
});
return false;
});
});
at the moment of wanting to redirect from the document loginclass.php with the code
header('Location: ../reporte.php');
nothing happens that I am doing wrong?