View sourcecode

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

password_form.php

51 lines ASCII 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
<?php
    session_start
();
    include(
'check_login.php');
?>
<!DOCTYPE html>
<html lang="sv">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Konton 1a</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous">
</head>
<body>
    <div class="container-fluid pt-5">
        <?php
            
echo'<div class="row justify-content-center">';
            if(isset(
$_GET['mess'])){
                switch(
$_GET['mess']){
                    case 
'wrong':
                        echo
"<div class=\"alert alert-danger col-md-4\" role=\"alert\">
                                Wrong username or password!
                            </div>"
;
                        break;
                }
            }
            else{
                echo
'<div class="container py-4"></div>';
            }
            echo
'</div>';
            echo
'<div class="row justify-content-center">
                    <form class="col-md-4 p-4 border border-success-subtle rounded" action="change_password.php" method="POST">
                        <div class="mb-3">
                            <label for="exampleInputEmail1" class="form-label">Username</label>
                            <input type="text" class="form-control" id="exampleInputEmail1" name="username" required>
                        </div>
                        <div class="mb-3">
                            <label for="exampleInputPassword1" class="form-label">Old password</label>
                            <input type="password" class="form-control" id="exampleInputPassword1" name="password" required>
                        </div>
                        <div class="mb-3">
                            <label for="exampleInputPassword2" class="form-label">New password</label>
                            <input type="password" class="form-control" id="exampleInputPassword2" name="newpassword" required>
                        </div>
                        <button type="submit" class="btn btn-success mb-2">Change password</button>
                    </form>
                </div>
            '
;
        
?>
    </div>
</body>
</html>