CodeIgniter has a helper function that you can use to repopulate your form. It’s in the form helper. To use it, load the helper first. apps/main/controllers/formexample.php [sourcecode] function __construct() { parent::__construct(); $this->load->helper(‘form’); } [/sourcecode] set_value returns the value from the $_POST array for the specified field. It can be used to retrieve values for textarea‘s Full Article…
CodeIgniter .htaccess Setup
CodeIgniter provides the option to use Search Engine friendly URL’s in your application. Search Engine friendly URL’s let’s spiders index your site better and are visually more attractive. mod_rewrite and the Index page Before anything else, make sure you have mod_rewrite enabled on your server. Once that’s taken care of, edit your index.php file and Full Article…
CodeIgniter Forms Tutorial
CodeIgniter offers a bunch of helpers to speed up development. There are URL Helpers, that assist in creating links, there are Form Helpers that help you create form elements, Text Helpers perform various text formatting routines, Cookie Helpers set and read cookies, File Helpers help you deal with files, etc. As the title implies this Full Article…
How To Upgrade to CodeIgniter 2.0
Last January 28, 2011 EllisLab officially released CodeIgniter 2.0.0. For those of you who are still using older versions of CodeIgniter here’s how to upgrade to CodeIgniter 2.0 : Download CodeIgniter 2.0 here. Step 1: Update CodeIgniter’s core libraries. Replace the contents of your “system” folder except your “application” folder. Be sure to have a Full Article…
Storing Codeigniter Session Data to a Database
One of the interesting things about CodeIgniter is how it creates and handles sessions. CodeIgniter doesn’t use native PHP sessions. Instead it uses a cookie to store the serialized data. This method, according to the guide, offers more flexibility for developers. In this example we’re going to try out the CI session class, and explore Full Article…
CodeIgniter Tip – How To Switch Between Two Databases
Most development starts locally (meaning local to the developer). This “usually” means that your database is local as well. However once your application is online and live, you now have two databases to keep up with for future development and most importantly ongoing testing. Here’s a little tip on how to manage both database settings Full Article…
CodeIgniter File Upload And Email Example
One of the benefits of using CodeIgniter is how it allows you to simplify tasks that used to be fairly complicated to code on their own. Why reinvent the wheel when you don’t have to. In this example, I’ll use the following CodeIgniter Libraries & Helpers to display a file upload form that sends the Full Article…
CodeIgniter Short URL Redirect Example
By now everyone is probably familiar with URL shorting services. I would venture to say that you are exposed to short URLs at least several times a day, especially if you are an avid Twitter user. There are a lot of companies providing these services and URL shorting apps for your own domain are becoming Full Article…