-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.php
68 lines (55 loc) · 1.68 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
session_start();
include("config.php");
if (!isset($_SESSION['valid'])) {
header("Location: index.php");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<title>Home</title>
</head>
<body>
<div class="nav">
<div class="logo">
<p><a href="home.php">Logo</a> </p>
</div>
<div class="right-links">
<?php
$id = $_SESSION['id'];
$query = mysqli_query($con, "SELECT*FROM users WHERE Id=$id");
while ($result = mysqli_fetch_assoc($query)) {
$res_Uname = $result['Username'];
$res_Email = $result['Email'];
$res_Age = $result['Age'];
$res_id = $result['Id'];
}
echo "<a href='edit.php?Id=$res_id'>Change Profile</a>";
?>
<a href="logout.php"> <button class="btn">Log Out</button> </a>
</div>
</div>
<main>
<div class="main-box top">
<div class="top">
<div class="box">
<p>Hello <b><?php echo $res_Uname ?></b>, Welcome</p>
</div>
<div class="box">
<p>Your email is <b><?php echo $res_Email ?></b>.</p>
</div>
</div>
<div class="bottom">
<div class="box">
<p>And you are <b><?php echo $res_Age ?> years old</b>.</p>
</div>
</div>
</div>
</main>
</body>
</html>