Load more data using AJAX – PHP

Learn how you can show a “Load more” button using AJAX, PHP and MySQL. No external library has been used in this tutorial. What is “Load more” button ? By “Load more” we mean creating a button that allows you to show only 10 or 20 records and on clicking that button will fetch next …

Reset password – PHP & MySQL

We will be using 4 files to implement reset password option. Your table structure should be like this: You need to create a table in database called users and the most important columns are email and reset_token. Sending email via localhost requires an Gmail account and you need to enable less secure apps for your account. You can enable it …

Attach files in email – PHP

In this tutorial, we will teach you how you can attach files in an email using PHP. We will be using PHPMailer library to send an email. Attach files in email – PHP We will be creating a simple form to enter email address of receiver, subject, message and ability to select a file. That …

Upload, Download and Delete files – PHP

We will teach you how you can upload, download and delete files in PHP. We will be implementing 3 functions and will be creating 3 files for each function: Upload file Start off, by creating 2 files index.php and upload.php, also create a folder named uploads all uploaded files will be stored in this folder. If you are using Mac, …

Display dynamic dropdown list – PHP

In this tutorial, we will be creating a dynamic dropdown to display list of orders. On selecting order from list, we display all product’s code in that order. And on selecting the product code, it will display the product’s detail. We will be using a sample database named classicmodels, it is attached in the source files …

View detail of user selected record – PHP

In this article, we will teach you how you can view detail of user selected record in PHP. We will display detail in Bootstrap modal. For example, you are displaying a list of users or products or anything that has so much attributes that you cannot display them all in 1 table. That is where …

Calculate difference between 2 dates – jQuery

Demo – Calculate difference between 2 dates Convert time to different timezones Calculating difference between 2 dates requires 2 calendars to pick dates or you may want to calculate difference based on some database values. For example, say you have a project management site and when you create a project you also set it’s deadline …

Secure your website using CSRF PHP

Cross site request forgery (CSRF) is a form of attack where are person sends an unwanted action as if he is a logged in user. We can secure our website from CSRF attack in PHP. A successful CSRF attack can result in access to unauthorized data. Changing passwords of other users and stealing browser cookies …

Dynamic countdown timer in PHP

Convert time to different timezones We will be creating a countdown timer in PHP based on some DateTime column value from MySQL database. These type of timers are used mostly in bidding/auction sites where you display a countdown timer till last bid. You can also show a countdown timer to special events too like countdown till …