-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprofile.php
More file actions
65 lines (52 loc) · 1.91 KB
/
profile.php
File metadata and controls
65 lines (52 loc) · 1.91 KB
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
<?php session_start();
require("env.php");
$conn = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_DATABASE);
if($conn->connect_error){
die("Connection failed: ". $conn->connect_error);
}
$email = $_SESSION['email'];
$sql = "SELECT * FROM users WHERE email='$email'";
$result = $conn -> query($sql) or die($conn->error);
$row = $result->fetch_assoc();
$data = array();
$count = 0;
$fname = $row['fname'];
$lname = $row['lname'];
$email = $row['email'];
$phone = $row['phone'];
?>
<!DOCTYPE html>
<html>
<head>
<title>Profile Page</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel='stylesheet' type="text/css" href='css/profile.css'>
<link rel="stylesheet" href="css/header.css">
<link rel="stylesheet" href="css/navigation.css">
<link rel="stylesheet" href="css/footer.css">
</head>
<body>
<?php include('includes/header.php'); ?>
<?php include('includes/navigation.php'); ?>
<section class="profile" style="background-image: url('images/background/profilebackground.jpg');">
<div class="profileHeader">
</div>
<div class="container">
<img class="profile-picture" src="images\icons\profile.png" alt="Profile Picture">
<h1 class="name"><?php echo $fname." ".$lname?></h1>
<div class="contact">
<div class="contact-item">
<p class="contact-item__label">Email</p>
<p class="contact-item__value"><?php echo $email?></p>
</div>
<div class="contact-item">
<p class="contact-item__label">Phone</p>
<p class="contact-item__value"><?php echo $phone?></p>
</div>
</div>
<a href="logout.php"><input type="button" class="logoutProfile" value="Log out" ></a>
</div>
</section>
<?php include('includes/footer.php'); ?>
</body>
</html>