PHP Code Samples

Recent Tutorial

PHP Login with OTP Authentication

March 21, 2017
Login with an OTP code is a secure method for the user authentication process. In this method, a one-time password is generated dynamically and sent to the user who attempts login. OTP can be sent to the user’s email or his mobile phone. When the user enters the OTP code then the application will authenticate the […]
This tutorial was added to PHP.

AJAX Pagination with PHP

March 11, 2017
In this tutorial, we are going to see an example PHP code to add pagination to a list of records retrieved from database. I am using AJAX to fetch records for each page from database with jQuery. In a previous tutorial, we have seen already about AJAX pagination. In this example, I have added an option to […]
This tutorial was added to PHP.

Facebook Like Header Notification in PHP

November 22, 2016
In Facebook like social networking websites, we can see notification alert in the page header. In this tutorial, we are going to add such header notification to notify the user about latest data. This will be helpful to keep the user updated by notifying what is new. In this example, we have a notification icon […]
This tutorial was added to PHP.

Highlighting Keywords in Search Results with PHP

May 31, 2016
Highlighting keywords in search results will help a user to identify appropriate results easily. In a previous tutorial, we have seen advanced search in PHP. In this example, we are highlighting multiple keywords in search results. We are searching database title and description to check if the keyword has occurred. If match found we highlight those […]
This tutorial was added to PHP.

Advanced Search using PHP

May 30, 2016
In PHP advance search we have many options to filter MySQL data. Using these options we are creating database query condition to make an advanced search. In a previous tutorial, we have seen simple PHP search to filter MySQL records which have only one field to enter the search keyword. In the advanced search form, […]
This tutorial was added to PHP.

PHP Forgot Password Recover Code

March 23, 2016
In this post, we are going to see an example to learn how to recover the forgot password. In this example we have a forgot password form to get the username or email to recover the password. After form submits, we are sending password recovery email to the user. The Password recovery email has a […]
This tutorial was added to PHP.

PHP Login Script with Remember Me

March 23, 2016
In a login script, remember me feature is used to preserve the login name and password entered by the user. And it can be populated in the login form at the time of login. It minimizes the user effort by preventing to enter login details for each time. Some days before, we have seen PHP […]
This tutorial was added to PHP.

PHP MySQL Date Range Search with jQuery DatePicker

February 14, 2016
In this tutorial, we are going to see how to search database records date between two given ranges. It will return the filtered results from the database based on these dates input. In this tutorial, we are using jQuery DatePicker to choose the dates for the search options. These date inputs are used to form […]
This tutorial was added to PHP.

Paypal Payment Gateway Integration in PHP

August 21, 2015
In this tutorial, we are going to see about how to integrate payment gateway in PHP via Paypal. We are going to see an example code in PHP for payment integration. In this example, we are using Paypal sandbox (test) mode to check payment flow before going live. Paypal Payment Integration Steps Login / Sign […]
This tutorial was added to PHP.

Show PHP Captcha on Failed Login Attempts

February 2, 2015
In this tutorial, we are going to show captcha code if a user tried more than 3 failed login attempts. In the previous tutorial, we have seen user login and PHP captcha. So, we are going to combine this two tutorial to add captcha control for invalid login. In this example, we have a MySQL […]
This tutorial was added to PHP.

Sorting MySQL Row Order using jQuery

January 31, 2015
In this tutorial we are going to learn how to change the MySQL row order. We are using jQuery to display sortable list of MySQL rows. We are using jQuery sortable() function to change the row order by drag and drop the rows. After changing we should save the new order in database. View Demo […]
This tutorial was added to PHP.

Read Facebook Data via Graph API using PHP

December 8, 2014
In this tutorial, we are going to read data from Facebook by using Graph API. This is an HTTP-based API using which we can post and get data to and from the Facebook social graph. In this example, we are going to get some basic data like id, name, and profile picture by sending Facebook […]
This tutorial was added to PHP.

User Login Session Timeout Logout in PHP

November 24, 2014
This PHP tutorial is used for setting user login session expiration time for the logged-in user. Once, this time is elapsed then the user no longer access the authenticated pages of the application. In the previous tutorial, we have created session variables once a user logged in to our application. In this tutorial, we are […]
This tutorial was added to PHP.

PHP CRUD with Search and Pagination

November 2, 2014
In this tutorial, we will see about a simple PHP application for database create, read, update and delete (CRUD) operations. With these CRUD operations, we will also have search and pagination features integrated to it. Earlier, we saw about CRUD with AJAX and CRUD without AJAX (both did not have search and pagination). Now in […]
This tutorial was added to PHP.

Command Line PHP

August 25, 2014
Using PHP though command line is possible and we will see how to do it in this tutorial. Generally, PHP is used for creating web-based applications. There are occasions where PHP script can be used apart from regular web applications such as automatic mail sending, Cron job for getting backup, automatic log tracking and etc. […]
This tutorial was added to PHP.

↑ Back to Top