-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofile.php
130 lines (120 loc) · 2.81 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?php
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<title>Profile Card</title>
<style type="">
body{
margin: 0px;
padding: 0px;
background: #f1f1f1;
font-family: arial;
box-sizing: border-box;
}
.card-container{
width: 300px;
height: 430px;
background: #FFF;
border-radius: 6px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
box-shadow: 0px 1px 10px 1px #000;
overflow: hidden;
display: inline-block;
}
.upper-container{
height: 150px;
background: #7F00FF;
}
.image-container{
background: white;
width: 80px;
height: 80px;
border-radius: 50%;
padding: 5px;
transform: translate(100px,100px);
}
.image-container img{
width: 80px;
height: 80px;
border-radius: 50%;
}
.lower-container{
height: 280px;
background: #FFF;
padding: 20px;
padding-top: 40px;
text-align: center;
}
.lower-container h3, h4{
box-sizing: border-box;
line-height: .6;
font-weight: lighter;
}
.lower-container h4{
color: #7F00FF;
opacity: .6;
font-weight: bold;
}
.lower-container p{
font-size: 16px;
color: gray;
}
.lower-container .btn{
padding: 12px 20px;
background: #7F00FF;
border: none;
color: white;
border-radius: 30px;
font-size: 12px;
text-decoration: none;
font-weight: bold;
transition: all .3s ease-in;
}
.lower-container .btn:hover{
background: transparent;
color: #7F00FF;
border: 2px solid #7F00FF;
}
</style>
</head>
<body>
<?php
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = '';
$dbname = 'bookworms';
$conn = mysqli_connect($dbhost, $dbuser, $dbpass,$dbname);
$uname = $_SESSION['username'];
if(! $conn ) {
die('Could not connect: ' . mysqli_error());
}
$sql = "SELECT name,email,phone,location FROM users WHERE username= '$uname' ";
$result = mysqli_query($conn, $sql);
$getrow = mysqli_fetch_row($result);
mysqli_close($conn);
?>
<div class="card-container">
<div class="upper-container">
<div class="image-container">
<img src="" />
</div>
</div>
<div class="lower-container">
<div>
<h3><?php echo $getrow[0] ?></h3>
<h3><?php echo $getrow[2] ?></h3>
<h3><?php echo $getrow[1] ?></h3>
<h3><?php echo $getrow[3] ?></h3>
</div>
<div>
<a href="update.php" class="btn">Update profile</a>
</div>
</div>
</div>
</body>
</html>