Category Archives: Codeigniter

create custom logging in codeigniter

Rakesh Sharma      No Comments  

How to create custom logging in codeigniter by extending codeigniter logging system

We already have default beautiful logging system in codeigniter. Which are really more helpful, I am just extending the logging system for showing custom log message in codeigniter.

Default codeigniter logging we can see in application/config.php.

Parse html template in codeigniter

Rakesh Sharma      No Comments  

Parse html template in codeigniter using Template Parser Class Sometimes we need to parse html data, like sending an email with html template. In codeigniter a library exist to handle this process. Let’s see how to parse html template in codeigniter. In codeigniter their is Template Parser Class, which handle… Read more »

Secure codeigniter application using csrf token

Rakesh Sharma      5 Comments  

Secure codeigniter application using csrf token and using with ajax call

In codeigniter 2 Cross Site Request Forgery (CSRF or XSRF) protection is inbuilt feature. We need to just change the config variable in config file to use csrf protection. once you have enabled csrf protection your all forms has been secured. Now your codeigniter application forms POST requests has been secured using csrf token.

Create custom config file in codeigniter

Rakesh Sharma      1 Comment  

How to create custom config and fetch config items :-

We need to create own custom config file in codeigniter to enhance or add some more config items. In codeigniter we have already a config file in(application/config/config.php) we can add more items directly in it or can create our own custom config file. Altering existing config file is not a good idea so we need to create a new config file. In codeigniter all config settings are in $config array. if you look into inbuilt config file you will found all config stored in $config array. below we will see an example of custom config file in codeigniter.

Upload files in codeigniter

Rakesh Sharma      1 Comment  

How to upload files,images in codeigniter with image preview

We have an inbuilt class for upload files in codeigniter. using upload class we can easily upload files or images in codeigniter. for upload we need to set some configuration and need to load upload library.

How to use captcha in codeigniter

Rakesh Sharma      2 Comments  

How to use captcha in codeigniter using session
What is captcha :- A program that use for human verification or program which protect websites against bots, spam etc.
Generally Captcha contain a image for human challenge on forms for human read and enter captcha image text. In codeigniter we can easily add captcha to website using captcha helper class. it’s provided by codeigniter default. We are using session and a callback function to validate a captcha field/words. Below i am sharing an example how we can add captcha in codeigniter website.

Create custom library in codeigniter

Rakesh Sharma      No Comments  

Creating and using custom libraries, extend native libraries in codeigniter

Codeigniter libraries means classes which located in libraries directory. so for create our own custom library in codeigniter we need to build classes and store class file in libraries directory full path of libraries directory will be “application/libraries”. It’s easy to create new/ custom library , replace native or extend native library in codeigniter.
Below in this tutorial we will discuss :-

1. Create new/custom libraries
2. Using new/custom libraries
3. Extend native libraries

Integrate ckeditor in codeigniter

Rakesh Sharma      16 Comments  

Integrate ckeditor in codeigniter :-

CKEditor is a text editor used by mostly sites and also under public license. it’s easy to use with php but need more effort to use ckeditor in codeigniter. i am trying to make it simple and sharing what i have done to integrate ckeditor or ckfinder in codeigniter site.
I am using both ckeditor and ckfinder in codeigniter to use images also. we need to include libraries and make controller and need some code to view for done.

Add active class to menu in codeigniter

Rakesh Sharma      1 Comment  

Add active class to menu in codeigniter :-

In codeigniter it’s easy to add active class to current menu or highlight current page in menu item. so we can check which page we have.
i am using helper to active current menu or add active class to menu in codeigniter.
We need to follow some steps to highlight current page in menu or get current page to add active class in codeigniter.
let’s see how to add active class to menu in codeigniter.

Credit card validation in codeigniter

Rakesh Sharma      No Comments  

Credit card validation in codeigniter :-

I found a good code for credit card validation in php. and working with codeigniter so i need to use this code in codeigniter so i make a credit card validation helper in codeigniter and easily use this.
This is good and easy integration credit card validation code i found. you can also use this by making a library in codeigniter but i am sharing what i have to use this in codeigniter.

Using helper :-