PHP Code Samples

Object-Oriented Poll System using PHP

March 27, 2018
Object-oriented programming is used to design, develop and implement many simple as well as complex applications. We have already seen object-oriented features of PHP in a previous tutorial. Let us use object-oriented programming to create PHP poll system.  I have created a poll system to let the user vote for their favorite courses. The user will […]
This tutorial was added to PHP.

Show Image Thumbnail by YouTube Video URL using PHP

February 27, 2018
Thumbnails are used for preview a single or group of media entities in a single explorer window. By showing thumbnails, we can have a shortcut or quick-view to see more voluminous data without navigation. Websites use thumbnails to showcase content in a gallery format. For example, the online shopping cart websites showcase their product gallery with image thumbnails. […]
This tutorial was added to PHP.

PHP Comments System with Like Unlike

February 2, 2018
Many social media websites like Facebook have the options to add like unlike for the posts, links, photos added by the user. Adding likes and unlikes using AJAX will give a good user experience. It can be used effectively to filter and sort content. Sometimes, it can also be used to identify weeds out of […]
This tutorial was added to PHP.

Star Rating with PHP and jQuery AJAX

January 22, 2018
Star rating is used to rank pages, articles or posts published to the end user. This will help the user to identify and shortlist quality contents that are highly ranked. In this article, we are going to see how to create a PHP star rating system using jQuery AJAX. This article is an improved version […]
This tutorial was added to PHP.

Comments System using PHP and Ajax

December 18, 2017
In this tutorial, we are going to see how to create an AJAX based simple comment system using PHP. This comments system includes features to add reply for any comment added by the user. I used jQuery AJAX to add the comment/reply to the database and show them to the users. As it uses the  AJAX, […]
This tutorial was added to PHP.

Extract Content using PHP and Preview like Facebook

December 15, 2017
While sharing URLs, if the client automatically extracts title and image to post it as preview, then that would be nice. In many social media websites like Facebook and LinkedIn we can see that feature. They extract title and meta information on sharing links. In this tutorial, we are going to extract the page title, […]
This tutorial was added to PHP.

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.

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
Advanced search provides more options to the user to filter and narrow down the search result. Advanced search will be convenient for the end users and a search implementation without advanced option will be useless in many cases. Even Google search has ‘advanced search’ option.  In a previous tutorial, we have seen simple PHP search […]
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.

↑ Back to Top