How to send AJAX request using jQuery in CakePHP 4

AJAX (Asynchronous JavaScript and XML) is an important part when building a dynamic web application. You can send requests to a server and update parts of a web page without reloading the whole page.

In CakePHP 4 CSRF protection is already enabled, you can use this to securely send AJAX requests.

In this tutorial, I show how you can send AJAX request using jQuery with and without a CSRF token in CakePHP 4 project.

How to send AJAX request using jQuery in CakePHP 4

Read more

How to Add Toggle button in DataTables with jQuery PHP

Adding pagination on the page becomes easier with the DataTables plugin. It is equipped with essential features such as searching, sorting, and customizable rows per page.

Elevate user interaction by seamlessly integrating action buttons into the list, for these need to update the AJAX script.

In this tutorial, I show how you can add a toggle button to change user status in DataTable AJAX pagination with PHP.

How to Add Toggle button in Datatables with jQuery PHP

Read more

5 Star Rating system with jQuery AJAX in CodeIgniter 4

The 5 star rating system allows users to rate articles on a scale of 1 to 5.

It is a popular way for visitors to merchant websites to rate the quality of products and services. It is also commonly used to rate the quality of user-generated content, such as reviews and comments.

In this tutorial, I am creating a 5 star rating system in CodeIgniter 4 where the ratings will be stored in a database and the average rating will be displayed with the article. Users can rate an article and based on the rating the average rating gets updated.

5 Star rating system with jQuery AJAX in CodeIgniter 4

Read more

Load content on Page Scroll using JavaScript and PHP

Data is dynamically loaded on the page when the user reaches the bottom of the page while scrolling.

User doesn’t have to click on any action button to load new records. For doing this require sending AJAX request to fetch data on page scroll.

In this tutorial, I show how you can load content from MySQL database on page scroll using JavaScript and PHP.

Load content on page scroll using JavaScript and PHP

Read more