
In this article I want to explain how to create login/Admin login page with session in codeIgnitor . CodeIgnitor based on MVC(Model View Controller), Codeigniter can be also modified to use Hierarchical Model View Controller which allows developers to maintain modular grouping of Controller, Models and View arranged in a sub-directory format. We are going to create admin login form and also create controller and model of login, CodeIgnitor session is different from simple PHP, So I will explain login full process step by step. First download codeIgnitor from https://codeigniter.com/download and extract zip file and copy all files and paste it in your project. Next set base url in config.php file in codeignitor as given below.
1 2 3 |
$config['base_url'] = 'http://localhost/codeIgnitor/'; |
Now create a new database and create a admin table in database with given below fields.
1 2 3 4 5 6 7 8 |
CREATE TABLE IF NOT EXISTS `admin` ( `id` int(11) NOT NULL AUTO_INCREMENT, `admin_name` varchar(255) NOT NULL, `admin_password` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) |
And make sure change database connection in config folder database.php file, there are four parameters are needs to
read more >>