View sourcecode

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

login.php

64 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
if (isset($_SESSION["email"])){
    
header("location:home.php");
    exit();
}
if(isset(
$_GET["mess"])){
        switch(
$_GET["mess"]){
            case 
"ERROR":
                echo 
"<mark style=\"background-color: rgba(255, 130, 130, 1); border: 1px solid rgba(255, 0, 0, 1);\">Fel användarnamn eller lösenord</mark>";
                break;
            case 
"LOGOUT":
                echo 
"<mark style=\"background-color: rgba(130, 255, 136, 1); border: 1px solid rgba(27, 179, 6, 1);\">Du har loggats ut :)</mark>";
                break;
            case 
"SESSION_END":
                echo 
"<mark>Sessionen löpte ut, logga gärna in igen</mark>";
                break;
            case 
"CREATED":
                echo 
"<mark style=\"background-color: rgba(130, 255, 136, 1); border: 1px solid rgba(27, 179, 6, 1);\">Konto skapat, logga gärna in</mark>";
                break;
            case 
"NEWPASS":
                echo 
"<mark>Lösenordet är bytt, logga gärna in igen</mark>";
                break;
        }
    }
    else{
        echo 
"<br>";
    }

?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Login - PHiNTERNET</title>
    <link rel="stylesheet" href="/spectre/spectre-master/dist/spectre.css">
    <script src="https://kit.fontawesome.com/0b0c9a8dc7.js" crossorigin="anonymous"></script>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Special+Gothic+Expanded+One&family=Special+Gothic:wght@400..700&display=swap" rel="stylesheet">
</head>
<body style="text-align: center;">
    <br>
    <h1 style="font-family: 'Special Gothic Expanded One', Helvetica;">PHiNTERNET</h1>
    <h3 style="font-family: 'Special Gothic Expanded One', Helvetica;">Log in</h3>
    <form method="post" action="h_logincontrol.php">
        <p>
            <label for="email">Email:</label>
            <input type="email" id="email" name="email" required>
        </p>
        <p>
            <label for="pass">Password:</label>
            <input type="password" id="pass" name="pass" required>
            <br>
            <input type="checkbox" onclick="passShow()"> Show Password
        </p>
        <p>
            <input type="submit" value="Log in" class="btn btn-primary">
        </p>
    </form>
    <a class="btn" href="signup.php">I want to sign up</a>
    <script src="/webbserver/projekt/re_bank01/passShow.js"></script>
</body>
</html>