403 error in AJAX to Controller |
Hello. I am trying to send an string from "View" to the "Controller" with AJAX, but give Error 403. (CodeIgniter 4)
You need to provide a lot more information than just this, before anyone can help you.
The only thing someone could point out is that a 403 is "access forbidden", if that helps.
(10-27-2019, 07:12 AM)ciadmin Wrote: You need to provide a lot more information than just this, before anyone can help you.View->textbox.php Code: <div style="text-align:center;"> Controller->Links.php PHP Code: class Links extends Controller
(10-27-2019, 07:55 AM)ecampait Wrote: Hi, I enabled CSRF and changed textbox.php View: Code: <div style="text-align:center;"> and this code is my Controller: PHP Code: class Links extends Controller
Your getting an error because your Ajax base url is wrong.
Add to your header on top at the bottom before the closing </head> tag Code: <!-- Pass base_url() and site_url() to JavaScript --> Then in your ajax method add this. Code: // Ajax url: Try that. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |