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

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

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

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

CodeIgniter _remap function?

CodeIgniter permits you to override its default routing behavior through the use of the _remap() function. As you already knew the second segment of the URI typically determines with function is in the controller get called and it will be passed as a parameter to the _remap() function. So to hide the real method name […]

Categories
CodeIgniter

How to write Sub Queries in Codeigniter Active Record ?

Codeigniter didn’t provide an option to use subqueries with active record class. So today I would like to provide simple and possible comprehensive techniques on “creating Sub Queries with Codeigniter Active Record”. Creating subquery in Codeigniter is as easy as creating the regular Active Record queries. The technique here is first we need to generate […]

Categories
CodeIgniter

AJAX + CSRF Protection in Codeigniter ?

Codeigniter 2.0 adds an important security feature to prevent CSRF (Cross Site Request Forgery) attacks. Even better, the feature is automatically added to your forms(if you enable CSRF in Config, and if you use CI form Helper). You might like this post – How to Enable CSRF (Cross Site Request Forgery) in CodeIgniter How CSRF […]

Categories
CodeIgniter

How to use Captcha in CodeIgniter?

In this tutorial, I will show you integrating Captcha in your CodeIgniter application. We gonna use CI’s builtin captcha helper and contains functions that assist in creating CAPTCHA images. This helper needs GD library installed on your server. Here are the steps to use Captcha helper in the CodeIgniter 3 application forms: Download and Install […]