Added (Check Duplicates Before Adding New User)
parent
0d1a392f42
commit
5507b7af91
16
login.php
16
login.php
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
session_start();
|
||||
|
||||
$config = include 'config.php';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$config = include 'config.php';
|
||||
$username = $_POST['username'];
|
||||
$password = $_POST['password'];
|
||||
|
||||
|
@ -21,27 +20,32 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||
<html>
|
||||
<head>
|
||||
<title>Login</title>
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container mt-5">
|
||||
<h2 class="mb-4 text-center">Login</h2>
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-4">
|
||||
<h2 class="text-center mb-4">Login</h2>
|
||||
<?php if (isset($error)): ?>
|
||||
<div class="alert alert-danger"><?php echo $error; ?></div>
|
||||
<?php endif; ?>
|
||||
<form method="post" action="login.php">
|
||||
<div class="mb-3">
|
||||
<label for="username" class="form-label">Username</label>
|
||||
<input type="text" class="form-control" id="username" name="username" required>
|
||||
<input type="text" class="form-control" id="username" name="username" required placeholder="Enter username">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">Password</label>
|
||||
<input type="password" class="form-control" id="password" name="password" required>
|
||||
<input type="password" class="form-control" id="password" name="password" required placeholder="Enter password">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary w-100">Login</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue