How to use POST while keeping CSRF as true |
12-28-2017, 06:09 AM
(This post was last modified: 12-28-2017, 07:17 AM by ciadmin. Edit Reason: Added code tags )
Hi,
I am using Codeigniter 3.1.1. And I want to submit the form using AJAX with CSRF protection enabled. So, I have set $config['csrf_protection'] = TRUE in config.php. But the POST request does not work and gives error as 'Forbidden' as I set the CSRF variable as TRUE. Can anybody help how can I use POST request while keeping $config['csrf_protection'] as TRUE. Below is the PHP code for reference: Code: <?php Below is the AJAX code for reference: Code: $(document).ready(function(){ Thanks, -Krati |
Messages In This Thread |
How to use POST while keeping CSRF as true - by kratisalgia - 12-28-2017, 06:09 AM
RE: How to use POST while keeping CSRF as true - by PaulD - 12-28-2017, 09:00 AM
RE: How to use POST while keeping CSRF as true - by dave friend - 12-28-2017, 02:24 PM
RE: How to use POST while keeping CSRF as true - by kratisalgia - 12-29-2017, 12:26 AM
RE: How to use POST while keeping CSRF as true - by dave friend - 12-29-2017, 08:04 AM
RE: How to use POST while keeping CSRF as true - by kratisalgia - 01-01-2018, 11:21 PM
RE: How to use POST while keeping CSRF as true - by dave friend - 01-02-2018, 06:42 AM
RE: How to use POST while keeping CSRF as true - by developer_fisdom - 06-05-2023, 04:13 AM
RE: How to use POST while keeping CSRF as true - by XtreemDeveloper - 01-01-2018, 11:41 PM
RE: How to use POST while keeping CSRF as true - by InsiteFX - 01-02-2018, 04:08 AM
|