<?php
session_start();
$errorMsg = "";
$validUser = $_SESSION["login"] === true;
if(isset($_POST["sub"])) {
  $validUser = $_POST["username"] == "admin" && $_POST["password"] == "2019radio";
  if(!$validUser) $errorMsg = "Falsch :c";
  else $_SESSION["login"] = true;
}
if($validUser) {
   header("Location: https://app.crisp.chat/website/1b1b9cff-741e-4078-8c24-65050684a375/visitors/"); die();
}
?>
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="content-type" content="text/html;charset=utf-8" />
  <link rel="stylesheet" type="text/css" href="style2.css">
  <title>Login</title>
</head>
<body>
  <form name="input" action="" method="post">
    <label for="username">Username:</label><input type="text" value="<?= $_POST["username"] ?>" id="username" name="username" />
    <label for="password">Password:</label><input type="password" value="" id="password" name="password" />
    <div class="error"><?= $errorMsg ?></div>
    <input type="submit" value="Einloggen" name="sub" />
  </form>
</body>
</html>