How I build User Registration and Form Validation Using CodeIgniter
The following is an important note in building a User Registration and Form Validation Using CodeIgniter.
There are two lines that were change/added as follows:
- $route['default_controller'] = "register";
- $route['success'] = "register/success";
On line 55 we have added database and session to load automatically. This means that you do not need to call it in your controller.
$autoload['libraries'] = array('database','session');
There were only two lines of code that were changed here.
At line 17:
$config['base_url'] = '<a href="http://localhost/CI/';" rel="nofollow">http://localhost/CI/';[/geshifilter-php]
At line 227:
$config['encryption_key'] = '0rGBISBT61k7453Ooq6343KjtGe9Xjv4';
To generate a random key of your own please visit Random Keygen.
The last configuration is the database.
Don’t forget to change the following as follows:
- $db['default']['hostname'] = 'localhost';
- $db['default']['username'] = 'root';
- $db['default']['password'] = '';
- $db['default']['database'] = 'ci_tutorial';
Then we have added the following files according to the folder it belongs:
Take note that you do not need to touch any code that is not under the application’s folder. That is, don’t modify any file under system’s folder.
CodeIgniter is a PHP framework and is maintained by the developer. Any modification to the system’s folder will be overwritten if you forgot to backup it when you upgrade to the latest version.