-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhome.php
45 lines (42 loc) · 1.07 KB
/
home.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
<?php
require_once('config.php');
session_start();
if (isset($_POST['logout'])) {
session_destroy();
header("location:login.php");
}
if (empty($_SESSION['email'])) {
header("location:login.php");
} else {
$email = $_SESSION['email'];
$return = user_info($email);
}
?>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<div class="container">
<header>
<h1>Welcome Back !</h1>
</header>
<div class="user_info">
<p>
Username: <?php echo $return['username'] ?><br />
Email: <?php echo $return['email'] ?>
</p>
</div>
<!-- Form Section -->
<form id="logout" action="" method="post">
<div class="form-group">
<button type="submit" name="logout" id="submit" class="submit-logout">
<h2>Logout</h2>
</button>
</div>
</form>
</div>
</body>
</html>