Login page (with database)
In earlier example, we learnt a simple login page with one single username and session.
Now we’ll make it with more than one users using database. A sign in and login page will be there for users.
Following pages are made in this example.
In the first page, you’ll have the option for Login and Sign In.
On Login, if user has entered correct credentials matching to database then he will be directed to data.php page. But if he has entered wrong information then incorrect username/password message will appear.
We have named our CodeIgniter folder as login_db. And our table name is signup.
We need to do some basic settings in our login_db CodeIgniter folder.
Go to autoload.php file, and do the following settings.
In the above snpashot, we have loaded the libraries and helper.
In database.php file, fill your username and database name. Our database name is codeigniter.
Now, we?ll start the example.
We have made file Main.php in application/controllers folder,
In application/views folder, login_view.php file is made.