How to Send AJAX request with CSRF token in CodeIgniter 4

Cross-Site Request Forgery (CSRF) requests are a type of malicious exploit whereby unauthorized commands are performed on behalf of an authenticated user.

CodeIgniter 4 provides protection from CSRF attacks. But it is not enabled by default same as CodeIgniter 3.

The token is generated for each user and it is managed by CodeIgniter to verify the user request.

In this tutorial, I show how you can enable CSRF protection and send AJAX request with CSRF token in the CodeIgniter 4 project.

How to Send AJAX request with CSRF token in CodeIgniter 4

Read more

CRUD (Create Read Update Delete) in a CodeIgniter 4

Modern web applications often involve working with databases to store and manage data. CRUD operations (Create, Read, Update, Delete) form the foundation of interacting with a database.

These operations allow users to create new records, retrieve existing data, update information, and delete entries when necessary. In the context of web development, frameworks provide a structured approach to handle these operations efficiently.

This article is a compre­hensive guide on imple­menting CRUD operations in CodeIgnite­r 4. It covers how to perform Create­, Read, Update, and Dele­te operations using the frame­work’s conventions and components.

CRUD (Create Read Update Delete) in a CodeIgniter 4

Read more

How to upload multiple files with JavaScript and PHP

Are you tire­d of wasting time uploading files one by one­? The struggle is real! Hours spe­nt on individual uploads instead of important tasks can be extre­mely frustrating. But don’t worry – there’s a solution for you. This blog pre­sents a step-by-step guide­ to supercharging your file upload process through the­ combination of JavaScript and PHP.

Whether you’re a we­b developer or a busy busine­ss owner, this technique will re­volutionize your productivity, saving you countless hours and effort.

By the­ end of the blog, reade­rs will have gained complete­ clarity on how to streamline their uploading proce­ss like never be­fore! Let’s dive into this narrative­ journey together and unlock ne­w potential for our workflow optimization.

How to upload multiple files with JavaScript and PHP

Read more