Login Form in CodeIgniter (without MySQL)
Here, we’ll make a simple login page with the help of session.
Go to file autoload.php in application/config/autoload.php
Set session in library and helper.
Create controller page Login.php in application/controllers folder.
Look at the above snapshot, we have created a session for a single user with Username juhi and Password 123. For a valid login and logout we will use this username and password.
Create view page login_view.php in application/views folder.
Create view page welcome_view.php in application/views folder to show the successful login message.
Output
Type URL localhost/login/index.php/Login
Now on entering wrong information we’ll be see unsuccessful message which we have set in login_view page in else part.
Now on entering right information, we’ll see welvome_view.php message.
Click on Logout, we’ll be directed to Login page.