How to check existing data with jquery validation library with codeigniter 4 csrf? |
God, how did you get to this age?
I hope this is just a sample code. But if you are using database queries in the controller this is a bad practice and a violation of the MVC pattern. Use the model to work with the database. 1. Use ->countAllResults() instead of ->get()->getResult(); 2. When you make a POST request with CSRF enabled, the hash changes. For each subsequent request, you must use a new hash. Since you don't, you will receive an HTTP 403 error. 3. Check out the manual for the json_encode function. And you will understand what you are doing wrong.(Hello HTTP 500 error) https://www.php.net/manual/en/function.json-encode.php And if you fully use the framework, then it is better to read the documentation on this topic https://codeigniter.com/user_guide/outgo...the-output |
Messages In This Thread |
How to check existing data with jquery validation library with codeigniter 4 csrf? - by onebuyu - 01-15-2021, 03:45 PM
RE: How to check existing data with jquery validation library with codeigniter 4 csrf? - by iRedds - 01-15-2021, 08:04 PM
RE: How to check existing data with jquery validation library with codeigniter 4 csrf? - by onebuyu - 01-16-2021, 12:39 AM
RE: How to check existing data with jquery validation library with codeigniter 4 csrf? - by iRedds - 01-16-2021, 03:03 PM
|