Webbserverprogrammering 1

Show sourcecode

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

webbsrvprg/exercises/slutprojekt/

actions.php
administer_users.php
create_code.php
index.php
login copy.php
login.php
main.php
password_renewals.php
setup.php
sign_up.php
verification.php
verify_mail.php

login copy.php

57 lines UTF-8 Windows (CRLF)
<?php
ini_set
('display_errors'1);
ini_set('display_startup_errors'1);
error_reporting(E_ALL);
session_start(["gc_maxlifetime" => 86400]);
?>

<!DOCTYPE html>
<html lang="sv">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Login</title>
    <style>
        fieldset {
            margin: 5px;
            padding: 5px;
            border: 2px solid black;
        }

        #show_password {
            width: 10em;
            border: 1px solid gray;
            background-color: lightgray;
        }

        * {
            box-sizing: border-box;
        }
    </style>
</head>

<body>
    <a href="sign_up.php" target="_blank">Skapa konto</a>
    <form method="POST" action="login.php">
        <fieldset>
            <legend>Logga in</legend>
            <input type="text" required maxlength="50" name="username" id="username"><label for="username">Användarnamn</label><br>
            <input type="password" required maxlength="255" minlength="8" name="password" id="password"><label for="password">Lösenord</label><br>
            <div id="show_password">Visa lösenord</div><br>
            <button type="submit">Logga in</button>
        </fieldset>
    </form>
    <script>
        const show_pass_btn = document.getElementById("show_password");
        const password_input = document.getElementById("password");
        show_pass_btn.addEventListener("mouseover", function() {
            password_input.type = "text";
        })
        show_pass_btn.addEventListener("mouseleave", function() {
            password_input.type = "password";
        })
    </script>
</body>

</html>