-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofile.php
executable file
·58 lines (49 loc) · 2 KB
/
profile.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
<?php
session_start();
require "mysqldbconn.php";
if (!isset($_SESSION['user_logged_in']) || $_SESSION['user_logged_in'] !== true) {
header('location:user-login.php');
}
$user_name = $_SESSION['user_name'];
$user_email = $_SESSION['user_email'];
$profile_picture = $_SESSION['profile_picture'] ?? 'img/default-profile.jpg';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/x-icon" href="img/favicon.ico">
<link href='https://fonts.googleapis.com/css?family=Bebas Neue' rel='stylesheet'>
<title>User Profile</title>
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<nav class="navbar">
<div class="logo"><a href="index.php" style="text-decoration: none; color:white;">
<p style="font-family: 'Bebas Neue';">Craftique</p>
</a></div>
<div class="nav-items">
<div class="category-list">
<a href="blog.html" class="category-item">Blog</a>
<a href="tutorial-vid.html" class="category-item">Tutorial</a>
</div>
<input type="text" class="search-bar" placeholder="Search...">
<a href="watchlist.html" class="nav-link">Watchlist</a>
<a href="orders.html" class="nav-link">Orders</a>
<a href="cart.html" class="nav-link">Cart</a>
<a href="logout.php" class="nav-link">Logout</a>
</div>
</nav>
<section class="profile-section">
<div class="profile-card">
<div class="profile-image">
<img src="<?php echo htmlspecialchars($profile_picture); ?>" alt="Profile Picture">
</div>
<h1 class="name"><?php echo htmlspecialchars($user_name); ?></h1>
<p class="email"><?php echo htmlspecialchars($user_email); ?></p><br>
<a href="edit-profile.php" class="edit-profile-btn">Edit Profile</a>
</div>
</section>
</body>
</html>