Categories
CodeIgniter

CodeIgniter 3 – Login

In this tutorial, I will show you creating a login system using CodeIgniter. To generate decent login form design we gonna use Twitter Bootstrap styles. We need a database and a table with user details so let’s import below sample SQL into the database or you can adjust the code according to your database, table, and […]

Categories
CodeIgniter

How to use Twilio to send SMS with CodeIgniter

In this post, I would like to show using of Twilio library within your CodeIgniter 3 project. Twilio is cloud communications platform for building SMS, Voice & Messaging applications. Here are the steps to send SMS messages using Twilio APIs in the CodeIgniter 3 application: Step 1: Download and install CodeIgniter. Step 2: Run below […]

Categories
CodeIgniter

How to insert data into database with CodeIgniter

In this post, I will show inserting data into database table using CodeIgniter. We gonna use CodeIgniter Active Records Pattern. This pattern allows information to be retrieved, inserted, and updated in your database with minimal scripting. let’s download and install the CodeIgniter as a first step and set your database configuration details in application/config/database.php file, […]

Categories
CodeIgniter

How to Enable CSRF (Cross Site Request Forgery) in CodeIgniter

In this post, I will show you enabling CSRF token in your CodeIgniter application. To enable CSRF (Cross Site Request Forgery) protection in CodeIgniter open application/config/config.php file change $config[‘csrf_protection’] = FALSE; to $config[‘csrf_protection’] = TRUE;, change below shown other configuration values of csrf as per your needs. If you create a form (form_open()) using CodeIgniter […]

Categories
CodeIgniter

Get CI’s object instance using get_instance() method

In this post, I will show you how you can access the CI’s instance object within your custom classes. You can utilize all of CodeIgniter’s native resources using $this instance. But $this instance only works within your controllers, your models, and your views. If you would like to use CodeIgniter’s classes from within your own […]

Categories
CodeIgniter

How to create custom helper in CodeIgniter

In this tutorial, I would like to show creating custom helper in your CodeIgniter application. Helper functions are used to avoid repeated code in your controllers’and views, it encourages to follow good practice called DRY. You can call the helper methods in your views as well as in your controllers. You might like this post […]

Categories
CodeIgniter

How to generate Excel using PhpSpreadsheet in CodeIgniter

In this post, I would like to show using of PhpSpreadsheet library within your CodeIgniter 3 project. PhpSpreadsheet is a pure PHP library for reading and writing spreadsheet files. Here is my another post, you might be interested in – How to use PHPExcel with CodeIgniter? Here are the steps to generate Excel in the […]

Categories
CodeIgniter

How to setup maintenance mode in CodeIgniter

In this post, I will show you how easy it is to setup maintenance mode in CodeIgniter using CI’s hooks. while updating your web application its always better to show meaningful maintenance message to the end users, instead of showing errors. We gonna use CIs hooks to set up the maintenance page. Using hooks you […]

Categories
CodeIgniter

Using mPDF with CodeIgniter 3

In my previous post, I wrote a tutorial on Generating a PDF in Codeigniter using mPDF and in that tutorial I covered mPDF library manual installation steps, without composer. So in this post, I would like to use CodeIgniter 3 and composer to install and to load mPDF library. Here are the steps to generate […]

Categories
CodeIgniter

Cascading Dropdown List in CodeIgniter

In this post, I will show very simple and powerful approach to create cascading dropdowns in your CodeIgniter application. Cascading drop-down? A cascading dropdown list is a series of dependent dropdown list controls in which one dropdown list control depends on the parent or previous dropdown list controls. The items in the dropdown list control […]

Categories
CodeIgniter

DomPDF Library using Codeigniter 3

In this tutorial, we will discuss how to generate PDF using DOMPDF with Codeigniter Framework version 3 and composer(PHP dependency manager). From the authors of Dompdf – Dompdf is an HTML to PDF converter. At its heart, DomPDF is (mostly) CSS 2.1 compliant HTML layout and rendering engine written in PHP. It is a style-driven […]

Categories
CodeIgniter

how to get the CI’s base url in JavaScript

I received a tutorial request from my reader that asked me how to access CI’s base URL inside the JavaScript/external JavaScript files. Editing base URL of the project after each and every deployment is very frustrating and idiotic. There must be a better way to handle this base_url automatically into our js files. Yes, there […]

Categories
CodeIgniter

Codeigniter – Save config data in database

In this post, I would like to show you saving config data in the database in your CodeIgniter application. And I will show you, How you can get these data when you need to use in your project. To achieve this you are going to use CodeIgniter hooks. To initialize the hooks class one must […]

Categories
CodeIgniter

Saving Session Data to a Database in CodeIgniter3

CodeIgniter natively support storing session in the database. You do not need to do any changes in code, just a few configurations and it will work. Storing session data in the database will increase the security of the application. Because when you have session data in the database, every time a valid session is found […]

Categories
CodeIgniter

Uploading file via FTP using CodeIgniter

We are going to discuss how to upload files to the remote server in CodeIgniter using CI’s FTP library. This library has limitations – SFTP and SSL FTP protocols are not supported, only standard FTP. CodeIgniter’s FTP Class permits files to be transferred to a remote server. Remote files can also be moved, renamed, and […]