I'm new to MVC development and so far I'm having trouble identifying the error when trying to save my form records. Gives the error message: 403 (Forbidden). I'm using Codeigniter.
My role:
$(document).ready(function () {
$('#btn-save').click(function () {
var dados = $('#form').serialize();
$.ajax({
type: 'POST',
dataType: 'json',
url: "<?php echo base_url('index.php/centros/cadastrar');?>",
async: true,
data: dados,
success: function (response) {
location.reload();
}
});
return false;
});
});
});