Today I’m going to show you, Login Page, in PHP with a Database namely MySQL with Source Code. Login Page or Login Form is very important to developing a web application or desktop application.
If you want to develop a web application or desktop application, First of All, you need to develop a Login Page with Database.
I don’t confirm what are you using in programming to develop applications, but must make a Login Page. Then you will redirect to Main Application Page.
So, If you have ideas about Make a Login Form with the help of Any Programming Language Such as PHP, C#, Python, and Java that’s great.

In this article, you will get a login Form in PHP with database source code, the complete project is attached in the Zipping file. You just need to download the project and review it. After that, you will get more ideas about the Login Form in PHP and MySQL.
Basically, more beginners in PHP programming language, are facing many problems to develop any web application or web with a Database.
So, I recommend they Download any PHP project with a Database. After that, they get ideas on it.
Login Page in PHP with Database Source Code
I will share Login Page in PHP with Database Source Code below, you need to download it. After downloading this project you need to extract it.
After Extracting the Login Page in PHP Project you can see many files with Extensions PHP, CSS3, and Database File.

You need to Copy the Complete Folder without SQL File and Paste it into htdoc Folder. After that you need to import the Database, First of All, go to MySQL Create a Database with Login Name, and Import the Login Database that’s it.
However, these are all about Login Pages in PHP and MySQL with the Source Code Project. The project will help you to make a new Login Form with a different design. I hope you understand as well. If you have any questions/suggestions about this topic, kindly comment on me in below comment section. After receiving your Email or Comment I will contact you very soon.
Login Page in HTML With CSS Code
Recently, I made a video tutorial to design the Login Form in PHP with the help of HTML5 and CSS3. If you want to learn How Can You Design Login Page in PHP. I have shared below video tutorial you can learn it step by step.
After learning Login Form in PHP, you are able to use PHP and MySQL to Develop a Dynamically Login Form. I have also made the video tutorial, you can learn how can you develop a personal login form in Php MySQL Database.
<!DOCTYPE html>
<html>
<head>
<title> Login Form in HTML5 and CSS3</title>
<link rel="stylesheet" a href="css\style.css">
<link rel="stylesheet" a href="css\font-awesome.min.css">
</head>
<body>
<div class="container">
<img src="image/login.png"/>
<form method='POST' action='#'>
<div class="form-input">
<input type="text" name="text" placeholder="Enter the User Name"/>
</div>
<div class="form-input">
<input type="password" name="password" placeholder="password"/>
</div>
<input type="submit" type="submit" value="LOGIN" class="btn-login"/>
</form>
</div>
</body>
</html>
Above mentioned code represents the login form page using HTML, you need to use CSS3 to design that, I’ve mentioned code on below you can use that to the design the login form.
body{
margin: 0 auto;
background-image: url("../image/technology.jpg");
background-repeat: no-repeat;
background-size: 100% 720px;
}
.container{
width: 500px;
height: 450px;
text-align: center;
margin: 0 auto;
background-color: rgba(44, 62, 80,0.7);
margin-top: 160px;
}
.container img{
width: 150px;
height: 150px;
margin-top: -60px;
}
input[type="text"],input[type="password"]{
margin-top: 30px;
height: 45px;
width: 300px;
font-size: 18px;
margin-bottom: 20px;
background-color: #fff;
padding-left: 40px;
}
.form-input::before{
content: "\f007";
font-family: "FontAwesome";
padding-left: 07px;
padding-top: 40px;
position: absolute;
font-size: 35px;
color: #2980b9;
}
.form-input:nth-child(2)::before{
content: "\f023";
}
.btn-login{
padding: 15px 25px;
border: none;
background-color: #27ae60;
color: #fff;
}
How to Develop Login in PHP with MySQL Database
Above mentioned codes are for designing login forms using HTML and CSS3, I’ve mentioned below the code that helps you to connect Php and MySQLi and also you can use that to make a login page in PHP.
<?php
$host="localhost";
$user="root";
$password="";
$db="demo";
mysql_connect($host,$user,$password);
mysql_select_db($db);
if(isset($_POST['username'])){
$uname=$_POST['username'];
$password=$_POST['password'];
$sql="select * from loginform where user='".$uname."'AND Pass='".$password."' limit 1";
$result=mysql_query($sql);
if(mysql_num_rows($result)==1){
echo " You Have Successfully Logged in";
exit();
}
else{
echo " You Have Entered Incorrect Password";
exit();
}
}
?>
If you want to get the source of the project, I’ve mentioned a downloadable link. That helps you download the source code of the project.
The above mentioned have a login page in Php with source code, you can download the above-mentioned project. I’ve mentioned the download link below, you can easily follow that to download it.
I’ve also mentioned another login page in PHP with the source below, you can also download it on your computer.
above mentioned have a different login page in PHP with source codes. I’ve also designed another helpful project that helps you to understand the login page in PHP with database and validation.
Login page in PHP with Database and Validation
However, I hope you liked the above-mentioned projects If you want to learn advanced registration and login forms in PHP and MySQL. I’ve also made a tutorial on this topic, you can watch the tutorial below.
Once you learned it, I hope you will understand everything from scratch.
Furthermore, In this article have many projects that help you to work on the Login page in PHP, I also mentioned the registration and login form in Php and MySQL. If you want to create a login page in PHP and MySQL with the session.
I’ve also made a tutorial on this topic, you can watch a tutorial below to understand How to Create Login Page in Php and MySQL with Session.
Create a Login Page in PHP and MySQL with the Session
You May Also Like: Complaint Management System in PHP
Thanks for Visiting and Reading the Complete Article, I hope this project is helpful and beneficial for you. Kindly share the project with personal friends on Social Media Networks and Also Subscribe to the Email for Getting Updates on My Website.
Thanks for Visiting and Watching the Complete video. I hope you have learned as well. Kindly, share my content/course on social networks. If you have any questions/suggestions about this topic, kindly submit a single comment or email me.
I will reply with your answer for a maximum of 24 hours. A subscriber to my Social Networks Pages and Emails to get updates. Thanks for the read and watching my video Tutorial.
Good job bro