-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
67 lines (59 loc) · 1.74 KB
/
index.php
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
65
66
67
<?php
session_start();
if (!isset($_SESSION['username'])) {
$_SESSION['msg'] = "You have to log in first";
header('location: login1.php');
}
if (isset($_GET['logout'])) {
session_destroy();
unset($_SESSION['username']);
header("location: login1.php");
}
?>
<!DOCTYPE html>
<html>
<head>
<title>HelaDevs: Successful!</title>
<link rel="stylesheet" type="text/css" href="styles.css">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<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=Fredoka:wght@600&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="icon" href="heladevs.png">
</head>
<body>
<div class="header">
<h2>Home Page</h2>
</div>
<div class="content">
<?php if (isset($_SESSION['success'])) : ?>
<div class="error success" >
<h3>
<?php
echo $_SESSION['success'];
unset($_SESSION['success']);
?>
</h3>
</div>
<?php endif ?>
<?php if (isset($_SESSION['username'])) : ?>
<p>
Welcome,
<strong>
<?php echo $_SESSION['username']; ?>!!!
</strong>
</p>
<p>
<a href="index.php?logout='1'" class="button">
Click here to Logout
</a><br>
<a href="layout.php" class="button">
Enter to Website
</a>
</p>
<?php endif ?>
</div>
</body>
</html>