dimanche 28 juin 2015

redirect not work properly in codeigniter

Halo, i'm using ajax to post form into controller codeigniter. I want to redirect after ajax post, but controller doesn't redirect.

This is my ajax

$.ajax({
    type:"POST",
    url:form.attr("action"),
    data:form.serialize(),

    success: function(){

     },
    error: function(){
    alert("failure");
    }
});

}); });

this is my controller

public function checkout_data(){
    $this->account_model->checkout_simpan();
    redirect('produk/payment/last_steps');
}

this is my form

<form class="form-horizontal col-md-offset-3" id="form-checkout" action="<?php echo base_url('produk/payment/checkout_data');?>">

What wrong with my code ?

Aucun commentaire:

Enregistrer un commentaire