TechSupportNepTechSupportNep - Programming & Tech

  • Home
  • C#.NET
  • PHP
  • JAVA
  • Python
  • ASP.NET
  • VB.NET
  • Android
  • C
  • Tech
    • Tech News
  • Patreoner
TechSupportNep
  • Home
  • Programming
  • PHP
  • How to Create Login Form in PHP using Dreamweaver and MySQL Database?[With Source Code]
PHP

How to Create Login Form in PHP using Dreamweaver and MySQL Database?[With Source Code]

By Er. Ran Bahadur B.K. Last updated Aug 15, 2021
0 1,928
Share

Hello guyz, In this simple but very important article i am going to give some tips to you how to create a login form in PHP using Dreamweaver CC and MySQL Database. Creating a login form is very simple tasks but it tells you how to connect to the database, even how to create database in you localhost and how to create table in the database and many more things.

Before this you should know how to define site and testing server in Dreamweaver cc because PHP is Server site scripting language thats why it does not executed by the browser. So for this reason you have to install the server application like Wamp server, xamp server for windows and PAMP Server for mac. Before starting this little project first read this article:

Now follow the following steps:

1. After download and installing open it and then open your localhost, for this open up your any browsing software and type localhost or 127.0.0.1 in the address bar. Then new page will appear then scroll down and find phpmyadmin and click on that. Then you will be able to see the login page. Login in by entering username and password (Default username is root and password is empty). And then click on new and create one database having any name you want and the click ok, then create table having any number of field you want but i am using four field in this case and click on go. After that, you need to insert the field name like: username, password. and then select the length as well as data type as your requirement and then click on save. You can watch the video for this designing part, you may understand better in video.

2. Write the following code:


<!doctype html>
<?php
$servername = "localhost";
$username="root";
$password="";
$dbname="test";
//create connection
$conn=new MySQLi($servername,$username,$password,$dbname);

//check the connection
if($conn->connect_error){
die("connection failed".$conn->connect_error);
}
if(isset($_POST['user'])){
$user=$_POST['user'];
$pass =$_POST['pass'];
$sql ="select * from login where username = '".$user."' and password='".$pass."' LIMIT 1";
$result = $conn->query($sql);
if($result->num_rows>0){
echo("you have successfully loggined");
exit();
}else{
echo("goto previous page");
exit();
}
}
?>
<html>
<head>
<meta charset="utf-8">
<title>login form</title>
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-wp-preserve="%3Cstyle%20type%3D%22text%2Fcss%22%3E%0Abody%20%7B%0Abackground-color%3A%20%23F1E2E2%3B%0A%7D%0A%3C%2Fstyle%3E" data-mce-resize="false" data-mce-placeholder="1" class="mce-object" width="20" height="20" alt="&lt;style&gt;" title="&lt;style&gt;" />
</head>

<body>
<form method="post" action="login.php">
username:<input type="text" name="user"><br><br>
password:<input type="text" name="pass"><br><br>
<input type="submit" value="login">
</form>
</body>
</html>

3. save the file in localhost and run.


For more details:

Continue Reading
connect php with databaseconnecting php project with databasecreate a simple login form in phpcreate login form in phphow to connect php with the mysql databaseHow To Create a Login Form in phphow to create a login page in html with databaseHow to create a Login page with PHP and MySQLHow to Create Login Page in PHP/MySQLMaking a login form using PHPPHP Login Examplephp login tutorialphp login with databasePHP MySQL Loginsimple login form in php
0 1,928
Share FacebookTwitterReddItWhatsAppPinterestEmail
Er. Ran Bahadur B.K.60 posts 56 comments

Ran Bahadur B.K. is the owner of TechSupportNep who is working with the aim of providing the quality Technology content. He is creating Tech and Programming videos, you can see all them in his YouTube Channel(https://www.youtube.com/TechSupportNep). He is also working with some company.

Prev Post

What is C Programming Language

Next Post

How to Create Login Window in C# using SQL Server Database in Visual Studio?

Leave a comment
Help Needed

This website is free of annoying ads. We want to keep it like this. You can help with your support:

Donate!

The need for Support! Why to Support?

If you need your own website? contact me!
erranbahadurbk
Fiverr
Seller
Hello there,This is me Ran Bahadur B.K., A graduated computer engineer. I have 3+ years of work experience in wordpress design and development. I have strong knowledge of HTML, CSS and PHP which are the three ingredients of web development. Currently i am working with the software company so i also have experience in desktop apps and mobile apps development.

Latest

Python

How to Create Login Application in Python using SQLite Database?

How to use View Binding in Android?

Windows 10 Build 1909 Features that you should know.

How to Create a Complete Login and Forgot Password System in java ?

Prev Next 1 of 15
  • About us
  • Contact us
  • Privacy Policy
  • Disclaimer
© 2022 All Rights Reserved.
Website By: Ran Bahadur B.K.