File tree Expand file tree Collapse file tree 3 files changed +22
-14
lines changed Expand file tree Collapse file tree 3 files changed +22
-14
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
- session_start ();
2
+ session_start ();
3
3
4
- // Controlla se l'utente è autenticato
5
- if (!isset ($ _SESSION ['success ' ])) {
6
- header ("Location: index.php " );
7
- exit ();
8
- }
9
-
10
- // Recupera il nome utente dalla sessione
11
- $ username = $ _SESSION ['username ' ];
4
+ // Controlla se l'utente è autenticato
5
+ if (!isset ($ _SESSION ['success ' ])) {
6
+ header ("Location: index.php " );
7
+ exit ();
8
+ }
12
9
?>
13
10
14
11
<!DOCTYPE html>
27
24
<body>
28
25
<div class="login-container">
29
26
<div class="login-box">
30
- <h1 class="text-center">Welcome, <?php echo $ username ?> ! </h1>
31
- <div class="text-center mt-4">
27
+ <h1 class="text-center">Welcome</h1>
28
+ <div class="text-center mt-4 mb-2 ">
32
29
<p>You have successfully logged in</p>
33
30
</div>
31
+ <div class="d-grid mt-4">
32
+ <a href="logout.php" class="btn btn-danger btn-block">Logout</a>
33
+ </div>
34
34
</div>
35
35
</div>
36
36
Original file line number Diff line number Diff line change 32
32
<label for="username">Username</label>
33
33
<input type="text" class="form-control" name="username" placeholder="Enter username" autocomplete="off">
34
34
</div>
35
- <div class="form-group mb-3 ">
35
+ <div class="form-group mb-4 ">
36
36
<label for="password">Password</label>
37
37
<input type="password" class="form-control" name="password" placeholder="Enter password" autocomplete="off">
38
38
</div>
39
- <div class="d-grid mt-3 ">
40
- <button type="submit" class="btn btn-primary btn-block">Login </button>
39
+ <div class="d-grid mt-4 ">
40
+ <button type="submit" class="btn btn-primary btn-block">Continue </button>
41
41
</div>
42
42
</form>
43
43
</div>
Original file line number Diff line number Diff line change
1
+ <?php
2
+ session_start ();
3
+
4
+ session_destroy ();
5
+
6
+ header ("Location: index.php " );
7
+ exit ();
8
+ ?>
You can’t perform that action at this time.
0 commit comments