-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofile.php
54 lines (49 loc) · 1.68 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
<?php
require "header.php";
include_once 'includes/dbh.inc.php';
{
$user = $_GET['user'];
$get_user = $conn->query("SELECT * FROM users WHERE idUsers = '$user'");
if ($get_user->num_rows == 1)
{
$profile_data = $get_user->fetch_assoc();
}
}
?>
<head>
<style>
<?php include 'stylesheet.css'; ?>
header {
background-image: url(../images/ankles.jpg);
}
</style>
<a href="index.php"><h3>Home</a> | <?php echo $profile_data['uidUsers'] ?>'s Profile </h3><p>
<figcaption class="profile"><a href="edit-profile.php?user=<?php echo $profile_data['uidUsers'] ?>">Edit Profile</a></figcaption>
<h2>Personal Information <?php
$visitor = $_SESSION['userId'];
if ($user == $visitor){
?>
<title><?php echo $profile_data['uidUsers'] ?>'s Profile</title>
</head>
<main>
</h2>
<figure style='float:left'>
<img class="profile" src="images/profiledefault.jpg" alt="profile default picture">
</figure>
<div style='float:left'>
<table>
<tr>
<td class="head">Username:<p></td><td class="info"><?php echo $profile_data['uidUsers'] ?><p></td>
</tr>
<tr>
<td class="head"> Email:</td><td class="info"><?php echo $profile_data['emailUsers'] ?></td>
</tr>
<?php
} else {
echo "<h5>An error occurred. Please login to this account before viewing personal information.</h5>";
}
?>
</table>
</div>
</main>
</html>