A user can access an application through the Login Page or Form In CodeIgniter by entering their username and password or by logging in with a social media account.
About the Project
The Login Page (Form) in CodeIgniter with Database was developed using CodeIgniter and MySQL Database as Back-End.
In this article, we’ll learn how to use CodeIgniter to create a Session In CodeIgniter For Login.
We created a login module in the login form.
A Login Form In CodeIgniter With Session, By providing a valid username and password, you can log in. If an invalid login or password is entered, an error message will appear.
CodeIgniter Login Form or Page: Project Information
| Project Name: | Login Page (Form) In CodeIgniter With Source Code |
| Language/s Used: | PHP with CodeIgniter Web Framework |
| PHP version (Recommended): | 5.6.3 |
| Database: | MySQL |
| Type: | Web Application |
| Developer: | IT SOURCECODE |
| Updates: | 0 |
What is CodeIgniter?
CodeIgniter is an Application Development Framework – a toolset – for PHP website developers.
Its purpose is to let you construct projects much faster than if you were programming code from the start by providing a rich set of libraries for common activities, as well as a simple interface and logical structure to access these libraries.
By reducing the amount of code required for a given operation, CodeIgniter allows you to focus more creatively on your project.
In this Login Query In CodeIgniter also includes a downloadable Login In CodeIgniter With Session free source code, just find the downloadable source code below and click to start downloading.
To start executing this Login Page In CodeIgniter With Database, make sure that you have sublime or any platform of PHP and MySQL installed on your computer.
How to run the CodeIgniter Login Page or Form?: A Step-by-step Tutorial with Source Code
Time needed: 5 minutes
These are the steps on how to run the Login Page In CodeIgniter With Database Source Code.
- Download Source Code
First, find the downloadable source code below and click to start downloading the source code file.

- Extract File
Next, after finishing downloading the file, go to the file location and right click the file and click extract.

- Copy Project Folder
Next, copy the project folder and paste it to C:\xampp\htdocs.

- Open Xampp
Next, open xampp and start the apache and mysql.

- Create Database
Next, click any browser type the URL localhost/phpmyadmin, and create a database.

- Import Database
Next, click the created database, click import to the right tab, click choose file, and import the sql file inside the download folder.

- Execute Project
final, type to the URL localhost/codeigniter_login.

How to Create a Login Page or Form in CodeIgniter With MySQL?
The code given below is for the login page module
views: login_page.php
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CodeIgniter Login (IT SOURCECODE)</title>
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>bootstrap/css/bootstrap.min.css">
</head>
<body class="bg-info">
<div class="container">
<h1 class="page-header text-center">CodeIgniter Login (IT SOURCECODE)</h1>
<div class="row">
<div class="col-sm-4 col-sm-offset-4">
<div class="login-panel panel panel-success">
<div class="panel-heading">
<h3 class="panel-title"><span class="glyphicon glyphicon-lock"></span> Login
</h3>
</div>
<div class="panel-body">
<form method="POST" action="<?php echo base_url(); ?>index.php/user/login">
<fieldset>
<div class="form-group">
<input class="form-control" placeholder="Email" type="email" name="email" required>
</div>
<div class="form-group">
<input class="form-control" placeholder="Password" type="password" name="password" required>
</div>
<button type="submit" class="btn btn-lg btn-success btn-block"><span class="glyphicon glyphicon-log-in"></span> Login</button>
</fieldset>
</form>
</div>
</div>
<?php
if($this->session->flashdata('error')){
?>
<div class="alert alert-danger text-center" style="margin-top:20px;">
<?php echo $this->session->flashdata('error'); ?>
</div>
<?php
}
?>
</div>
</div>
</div>
</body>
</html>Login Page Output:
The code given below is for the home module
views: home.php
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CodeIgniter Login</title>
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>bootstrap/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<h1 class="page-header text-center">CodeIgniter Login with Flashdata</h1>
<div class="row">
<div class="col-md-4 col-md-offset-4">
<?php
$user = $this->session->userdata('user');
extract($user);
?>
<h2>Welcome to Homepage </h2>
<h4>User Info:</h4>
<p>Fullname: <?php echo $fname; ?></p>
<p>Email: <?php echo $email; ?></p>
<p>Password: <?php echo $password; ?></p>
<a href="<?php echo base_url(); ?>index.php/user/logout" class="btn btn-danger">Logout</a>
</div>
</div>
</div>
</body>
</html>
Homepage Output:
Download the Source Code below
Anyway, if you want to level up your programming knowledge, especially PHP, try this new article I’ve made for you Best PHP Projects With Source Code Free Download.
Conclusion
This lesson did not cover all that a full-fledged tutorial would, but it did introduce you to the most important modules, developing controllers, and models.
We hope that our CodeIgniter instructional login page (form) offered you some insight into some of CodeIgniter’s basic design patterns, which you may build on.
Frequently Asked Questions
How does this CodeIgniter login or registration system work?
User signup form (with email verification optional), password hashing via PHP password_hash() / password_verify(), login form with session start, remember-me cookie, logout, password reset via emailed token. Foundation block for any user-facing capstone.
What CodeIgniter and PHP versions does this project require?
Most projects in this batch use CodeIgniter 3 (CI3 – the dominant version on tutorial sites) which runs on PHP 5.6 to PHP 8.1. A few newer projects use CodeIgniter 4 which requires PHP 7.4+. Check the system/CodeIgniter.php file or composer.json for exact version. To run: extract to your htdocs (XAMPP/WAMP/Laragon), update application/config/database.php with your MySQL credentials, import the included .sql file via phpMyAdmin, browse to the project folder URL.
How do I set up the database for this CodeIgniter project?
Open phpMyAdmin (or MySQL client), create a new empty database (typical names: ci_school, ci_pos, etc.). Import the included .sql file via the Import tab. Edit application/config/database.php: set ‘hostname’ to localhost, ‘database’ to the new DB name, ‘username’ and ‘password’ to your local MySQL credentials. If using CodeIgniter 4: edit .env with database.default.* settings.
Can I use this CodeIgniter project for a BSIT capstone or thesis?
Yes, but extend it. A bare CRUD app is too narrow for full capstone scope. Add: user roles via session checks, reports/dashboards (Chart.js + AJAX), PDF exports (TCPDF library), email notifications (CodeIgniter Email library), real domain extension (analytics, audit log, multi-branch support). Pair with Chapter 1-5 documentation matching your panel’s rubric.
Why am I getting ‘An Error Was Encountered’ or ‘404 Page Not Found’ errors?
Three common CodeIgniter issues: (1) Wrong base_url in application/config/config.php, set $config[‘base_url’] to your actual project URL (e.g. http://localhost/myproject/). (2) Apache mod_rewrite not enabled, run sudo a2enmod rewrite (Linux) or check XAMPP/WAMP config. (3) Missing .htaccess in project root with proper RewriteRule. For DB errors: verify credentials in application/config/database.php match your MySQL setup.
Where can I find more CodeIgniter projects with source code?
Browse the CodeIgniter Projects hub for the full library. For broader PHP capstones see PHP Projects (300+ vanilla PHP + MySQL systems). For modern PHP MVC alternatives see Laravel Projects (74 systems). For BSIT-focused capstone idea lists see 150 Best Capstone Project Ideas.
Related PHP Projects
- Login Page PHP Database Source Code
- Laravel Login Page With Source Code
- Secure Login Page Using Phpmysql
- Login With Facebook Using PHP
- Simple Login Form With Validation Using MySQL In PHP
- CodeIgniter Download File From Database With Source Code
Inquiries
If you have any questions or suggestions about the Login Page (Form) In CodeIgniter With Database, please feel free to leave a comment below.








what is the password for the compressed folder?