I have a function that is being called when I click a button. The data I pass on the function is not enclosed in a form tag so I have to manually include the csrf token:
function NewDeleteBox(box_id, batch_id, staff_id){
$.ajax({
url: 'oss/admin/delete_box',
type: "POST",
data: {'batch_id': batch_id, 'staff_id': staff_id, 'box_id': box_id, '<?php echo $this->security->get_csrf_token_name(); ?>': '<?php echo $this->security->get_csrf_hash();?>'},
success: function(data) {
}
});
}
However, my csrf_token_name and hash is not working. It shows just like how I declare them in my data.
Any idea why I'm getting this? Thanks!
