CodeIgniter 3 - 403 Forbidden on POST from jQuery.ajax() asynchronous request |
I am getting a 403 forbidden error on jQuery.ajax() post request.
[b][b][b]application/config/config.php[/b][/b][/b]
Code: $config['csrf_protection'] = TRUE; [b][b]application/views/billing.php[/b][/b]
Code: <input type="text" class="txt_csrfname" name="<?= $this->security->get_csrf_token_name(); ?>" value="<?= $this->security->get_csrf_hash(); ?>"> [b][b]assets/customers/js/bill.js[/b][/b] Code: function add_bill_by_ajax(bill_object,bill_id){ application/controllers/Bill.php Code: function add_bill_by_ajax(){ Browser Console errors Code: jquery-3.3.1.min.js:2 POST http://localhost/Bill/add_bill_by_ajax 403 (Forbidden) Browser Network errors Code: bill: "{\"customer_id\":\"1\",\"product_price_with_discount\":\"5000.00\",\"product_discount_amount\":\"0.00\",\"product_note\":\"\"}]}" $string = $this->load->view('return_view_as_data', '', TRUE);
|
Messages In This Thread |
CodeIgniter 3 - 403 Forbidden on POST from jQuery.ajax() asynchronous request - by josephgodwinke - 04-12-2021, 02:53 PM
RE: CodeIgniter 3 - 403 Forbidden on POST from jQuery.ajax() asynchronous request - by kleber - 04-19-2021, 06:45 AM
RE: CodeIgniter 3 - 403 Forbidden on POST from jQuery.ajax() asynchronous request - by josephgodwinke - 04-20-2021, 12:39 AM
RE: CodeIgniter 3 - 403 Forbidden on POST from jQuery.ajax() asynchronous request - by kleber - 04-20-2021, 08:35 AM
|