Get correct IP address using PHP

This tutorial will show you how you can correct IP address of a user who is visiting your website. If you work on PHP applications; sooner or later you are going to need to get the end user’s IP address. We use to get the IP address using get $_SERVER[‘REMOTE_ADDR’]. Today it is not so easy to get the actual…

Get MIME Type From File Extension Using PHP

MIME Type This tutorial will show you how you can get MIME type of a file using PHP program. Most of the times you may need to validate or check MIME type of a file when you upload a file for various reasons, such as, for KYC (Know Your Customer) purpose. In this tutorial I have defined an array which…

Force download a file using PHP

A force-download script can give you more control over a file download than you would have providing a direct link that may be the good thing for most of the time to read it online. But sometimes it can be very frustrating to click on a link to a document you want people to read, and then have to wait…

MySQL Database Backup using PHP

In this tutorial I am going to show you how to take MySQL database backup using PHP programming language. In the world of web it is important to take backup of our site and database frequently. You never know when you would come across unexpected error that may cause your site stop working. Here I will show you in PHP…

PHP MySQL Login Logout with Remember Me

This tutorial will show you how to login to an application with remember me functionality. Sometimes you need to remember username and password for few days or years so that next time onward a user can login without entering the username and password into the input fields. The username and password fields get populated automatically from the cookie where the…

Calculate Future or Past date in PHP

This tutorial will show you how can you calculate either future date from a particular date to “plus a number of given days” or past date from a particular date to “minus a number of given days”. Future or past date calculation may be required for various purposes such as to calculate the age of a person on future date…

Separating Front-end and Back-end in Codeigniter

Introduction This tutorial will show you an example on how to separate front-end and back-end in Codeigniter 3. Front-end which is mainly used by public users who navigate through the site and sometimes register themselves to get updates on the site activities, new posts, update on a particular post etc. Back-end which is mainly used by site author, administrator, editor…

Using Template in Codeigniter

This tutorial will show you an example on how to use template in Codeigniter. In an web application a template is recommended because there are certain regions or areas which are common to all pages and only the body portion of the page gets changed. Common areas like header, footer, left sidebar or right sidebar are mainly common areas for…

Read from and write to a CSV file using PHP

This tutorial shows how to read from a csv file and write to a csv file using PHP programming language. In this example I have shown how to read a csv file and display those values on the browser when you run the PHP file. I have also written those csv entries into another output csv file. There are few…

Google Custom Search Engine example in Codeigniter

In this tutorial I will show you how to integrate Google Custom Search Engine with Codeigniter. Prerequisites PHP Engine 5.4 or later Codeigniter 2.2 Apache http server 2.2 or later Knowledge of html, css, javascript, php Final Output Step 1. Create google account if you do not have already one or sign in to google cse(Custom Search Engine) using your…