The following files exists in this folder. Click to view.
login.php38 lines UTF-8 Unix (LF)
<?php
session_start();
if(isset($_SESSION["user"])){
header("location: account.php");
}
?>
<?php require("login.class.php") ?>
<?php
if(isset($_POST["submit"])){
$user = new LoginUser($_POST["username"], $_POST["password"]);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Inloggning, Olivers bank</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<form action="" method="post" enctype="multipart/form-data" autocomplete="off">
<h2>Logga in</h2>
<label>Användarnamn</label>
<input type="text" name="username">
<label>Lösenord</label>
<input type="password" name="password">
<button type="submit" name="submit">Logga in</button>
<p class="error"><?php echo @$user->error ?></p>
<p class="success"><?php echo @$user->success ?></p>
</form>
<a href="index.php">Skapa konto istället</a>
</body>