The following files exist in this folder. Click to view.
| Namn | Typ | Storlek |
|---|---|---|
| admin.php | PHP Fil | 415 B |
| check_login.php | PHP Fil | 607 B |
| index.php | PHP Fil | 2.5 KB |
| login.php | PHP Fil | 985 B |
| logout.php | PHP Fil | 585 B |
login.php38 lines ISO-8859-1 BOM Unix (LF) - Type: PHP Fil
<?php
session_start();
// inloggningsuppgifter
$valid_username = "Admin";
$valid_password = "1234";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$username = $_POST['username'] ?? '';
$password = $_POST['password'] ?? '';
if ($username === $valid_username && $password === $valid_password) {
$_SESSION['loggedin'] = true;
$_SESSION['username'] = $username;
header("Location: admin.php");
exit;
} else {
header("Location: index.php?error=1");
exit;
}
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<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">
<title>Inloggningsapplikation</title>
<link rel="stylesheet" href="style.css">
<link rel="icon" href="../../m02/Favicon-a.jpg" type="image/x-icon">
</head>
<body>
</body>
</html>