View sourcecode

The following files exists in this folder. Click to view.

index.php

44 lines UTF-8 Unix (LF)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
// shorthanded if
$mess=isset($_GET['mess']) ? "<p class='text-error'>".$_GET['mess']."</p>" "";
?>

<!DOCTYPE html>
<html lang="sv">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Inloggningsapplikation</title>
    <link rel="stylesheet" href="https://unpkg.com/spectre.css/dist/spectre.min.css">
  </head>
  <body>
    <div class="container">
      <div class="columns">
        <div class="column col-8">
          <h1>Inloggningsapplikationen</h1>
          <?php echo $mess;
          if(isset(
$_COOKIE['username'])){
            echo 
"<p>Med COOKIE kan du logga in direkt som <a href='login.php?with_cookie={$_COOKIE['username']}'>{$_COOKIE['username']}</a>.</p>";
          } 
?>
          <form method="POST" action="login.php">
            <div class="form-group">
              <label class="form-label" for="username">Användarnamn</label>
              <input class="form-input" id="username" name="username" type="text" required>
              <label class="form-label" for="password">Lösenord</label>
              <input class="form-input" id="password" name="password" type="password" required>
              <label class="form-checkbox">
              <input type="checkbox" name="keepLoggedIn">
              <i class="form-icon"></i> Håll mig inloggad
              </label>
              <input type="submit" class="btn btn-primary" value="Logga in">
            </div>
          </form>
          <hr>
          <a href="source.php">Länk till källkoden</a>
        </div>
      </div>
    </div>
  </body>
</html>