Category: PHP

All logical operation and database handling done in the Models like insert, update or fetch records.

Codeigniter has predefined Database methods to perform database request.

In the demonstration, with View show the HTML form and when the user submits the forms then call the Model method to insert record from the controller.

Insert record to Database Table - Codeigniter

PHP

Codeigniter is a lightweight PHP-based framework to develop the web application. It is based on MVC (Model View Controller) pattern.

  • The model handles the data processing – Return data, Insert, Update, or delete records from Database Table.
  • The view displays the final output.
  • The controller manages the Model and view. It handles the users’ inputs.

In this tutorial, I cover basis about Codeigniter.

How to install and setup Codeigniter

PHP

AJAX is use to communicate with the server to perform the action without the need to refresh the page.

You can either handle AJAX requests on the same page or on the separate page.

In this tutorial, I show how you can send and receive AJAX requests on the same page.

How to handle AJAX request on the same page - PHP

AJAX Jquery PHP

Most of the eCommerce sites e.g. Flipkart, Snapdeal, etc have a price range slider for searching purpose.

The user doesn’t have to enter price range manually.

It will automatically filter the list when the price is been changed by the user.

In this tutorial, I am implementing the similar type of functionality with AngularJS and PHP.

Using jQuery UI to create the slider.

Make Price Range Slider with AngularJS and PHP

AngularJS PHP

The alphabetical pagination searches the records according to the first character in a specific column.

You can either manually fix the characters from A-Z or use the database table column value to create the list.

In this demonstration, I list all available character from a field in the Table and show the total number of records with it. Filter the record whenever a character is being pressed from the list.

Create alphabetical pagination with PHP MySQL

PHP

It is always a better idea to check the entered username exists or not if you are allowing the users to choose username while registration and wants it to be unique.

With this, the user will instantly know that their chosen username is available or not.

Check if username exists with AngularJS

AngularJS PHP

The autocomplete functionality gives the user suggestions based on its input. From there, it can select an option.

In the demonstration, I am creating a search box and display suggestion list whenever the user input value in the search box.

Set selected value to search box when an option gets selected.

For implementing this functionality I am using AngularJS and PHP.

Create autocomplete search with AngularJS and PHP

AngularJS PHP

The infinite page scroll you have seen on the social networking sites – Facebook, Twitter or on e-commerce websites where the new content is automatically loaded when scrolling down to the web page.

For implementing this functionality using jQuery to detect page scroll when the user reaches the end of the web page then send an AJAX request to load new content.

Load content on page scroll with jQuery and AJAX

AJAX Jquery PHP

You don’t need to require any other extra plugin for working with Zip files.

PHP has ZipArchive class that allow us to create a zip file or extract existing file.

ZipArchive class extractTo() method is used to extract the zip file that takes destination absolute path as argument.

Extract the Zip file with PHP

PHP

You can save your uploading images in the database table for later use e.g. display user profile or product image, create the image gallery, etc.

There are two ways of doing this –

  • Save path or name of an image
  • Encode image into base64 format

In this tutorial, I show you both of the methods for storing and retrieving an image from the database table.

Upload and store an image in the database with PHP

DataBase PHP