picture and link below.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='content-type' content='text/html;charset=utf-8' />
<title>Login Page</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<h3 class="text-center">Login</h3>
<?php
$servername = "localhost";
$usernamedb = "root";
$passworddb = "";
$dbname1= "parent";
$mysqli = new mysqli($servername, $usernamedb, $passworddb, $dbname1);
if(isset($_POST['submit']))
{
$username = $mysqli->real_escape_string($_POST['username']);
$password = $mysqli->real_escape_string($_POST['password']);
if($username === 'username1' && $password === 'password1')
{
header('location:barcodev72.php');
}
else
{
echo "<div class='alert alert-danger'>Username and Password do not match.</div>";
}
}
?>
<form action = "" method="post">
<div class = "form-group">
<label for ="username">Username:</label>
<input type="text" class ="form-control" id="username" name="username" required>
</div>
<div class="form-group">
<label for="pwd">Password:</label>
<input type="password" class ="form-control" id="pwd" name="password" required>
</div>
<button type = "submit" name="submit" class="btn btn-default">Login</button>
</form>
</div>
</body>
</html>
Click this YouTube video link for more understanding.
No comments:
Post a Comment