Login System Using PHP and Mysql, we are going to create Login Page System Using PHP and Mysql Database. first, we create an HTML file in our code compiler then we will create a Style.css file to style up our code. We are using HTML, CSS, and PHP to create this tutorial. You can download all source code image from here.

Login System with Php and Mysql Database


you can use any compiler that you’re comfortable with.

Project used version


So, Let’s get started

Step 1:-

Create Login.php file in your compiler and write down your login page design code. So First, we are creating a design and add PHP code in the login.php file.

Import this Code in your Login.php file.


Step 2:-

Create Image folder in your root directory and place this images inside image folder. make sure your image path is the same which we place in the code if not then change the src attribute of image tag with your absolute image path.

Download this image from here

Background Image , Image_1.

Step 3:-

So, now our login.php file is complete. afterward, we are creating Style.css file to style up our login page. create a Style.css file in root folder. make sure in link element you will use absolute path of Style.css file.

Import this code in Style.css file:-


Step 3:-

After Importing this code in you Style.css file now we are creating a database in phpadmin. I am using XAMPP Control Panel.

Create php_login Database file in phpadmin and create a table with three fields id, uname, password.


And run this SQL query after you successfully created your table we want to insert some values to validate username and password. so type this command in sql query. we are inserting two values at a time.

import this code in sql query:-


After you SQL query successfully create move forward.