Redirect from inside a php page you are running Ajax

Yepkoo

Yepkoo
Staff member
JavaScript:
    $.ajax({
        type:"POST",
        url:"xxxxx.php",
        async: false,
        data: $("#form_id").serialize()
        success: function(data){
             if(data == 'redirect'){
                window.location.href='../Main/index.html';
             }else{
               alert(data);
             }
        });
 
Top