The following files exists in this folder. Click to view.
index.php66 lines ASCII Unix (LF) 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
<?php
session_start();
if(isset($_COOKIE['remember'])){
header('location: login.php');
exit();
}
?>
<!DOCTYPE html>
<html lang="sv">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Inlogg grund 1a</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous">
</head>
<body>
<div class="container-fluid pt-5">
<div class="row justify-content-center">
<?php
if(isset($_GET['mess']))
switch($_GET['mess']){
case 'wrong':
echo"<div class=\"alert alert-danger col-md-4\" role=\"alert\">
Wrong username or password!
</div>";
break;
case 'error':
echo"<div class=\"alert alert-danger col-md-4\" role=\"alert\">
An unexpected error occured.
</div>";
break;
case 'logout':
echo"<div class=\"alert alert-success col-md-4\" role=\"alert\">
You have been successfully logged out.
</div>";
break;
}
?>
</div>
<div class="row justify-content-center">
<form class="col-md-4" action="login.php" method="POST">
<div class="mb-3">
<label for="exampleInputEmail1" class="form-label">Username</label>
<input type="text" class="form-control" id="exampleInputEmail1" name="username" required>
<div class="invalid-feedback">
Please write your username.
</div>
</div>
<div class="mb-3">
<label for="exampleInputPassword1" class="form-label">Password</label>
<input type="password" class="form-control" id="exampleInputPassword1" name="password" required>
<div class="invalid-feedback">
Please write your password username.
</div>
</div>
<div class="mb-3 form-check">
<input type="checkbox" class="form-check-input" id="exampleCheck1" name="remember">
<label class="form-check-label" for="exampleCheck1">Remember me</label>
</div>
<button type="submit" class="btn btn-primary">Login</button>
</form>
</div>
</div>
</body>
</html>