-
Notifications
You must be signed in to change notification settings - Fork 1
/
edit-profile.php
156 lines (152 loc) · 7.13 KB
/
edit-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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Edit Profile | Instaclone</title>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
<link href="css/style.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
</head>
<body>
<?php
$username = $_GET['username'];
include_once 'connect.php';
$result = mysqli_query ($conn, "SELECT
profile_name,
profile_picture,
password,
bio,
email
FROM users
WHERE username = '$username' "
);
$row = mysqli_fetch_array($result);
$profile_name = $row['profile_name'];
$profile_picture = $row['profile_picture'];
$password = $row['password'];
$bio = $row['bio'];
$email = $row['email'];
?>
<nav class="navigation">
<a href="feed.php?username=<?php echo $username?>">
<img
src="images/navLogo.png"
alt="logo"
title="logo"
class="navigation__logo"
/>
</a>
<div class="navigation__search-container">
<i class="fa fa-search"></i>
<input type="text" placeholder="Search">
</div>
<div class="navigation__icons">
<a href="explore.html" class="navigation__link">
<i class="fa fa-compass"></i>
</a>
<a href="#" class="navigation__link">
<i class="fa fa-heart-o"></i>
</a>
<a href="profile.html" class="navigation__link">
<i class="fa fa-user-o"></i>
</a>
</div>
</nav>
<main class="edit-profile">
<section class="profile-form">
<header class="profile-form__header">
<div class="profile-form__avatar-container">
<img
src= <?php
if($profile_picture == null)
echo "images/avatar.svg";
else
echo $profile_picture;
?>
class="profile-form__avatar"
/>
</div>
<h4 class="profile-form__title"><?php echo $username?></h4>
</header>
<form action="submit-profile.php?curr_us=<?php echo $username?>" method = "post" class="edit-profile__form">
<div class="edit-profile__form-row">
<label for="name" class="edit-profile__label">Name
</label>
<input
name = "name"
type="text"
value="<?php echo $profile_name?>"
class="edit-profile__input"
/>
</div>
<div class="edit-profile__form-row">
<label for="username" class="edit-profile__label">
Username
</label>
<input
type="text"
name="username"
value="<?php echo $username?>"
class="edit-profile__input"
/>
</div>
<div class="edit-profile__form-row">
<label for="Password" class="edit-profile__label">
Password
</label>
<input
type="text"
name ="password"
value = "<?php echo $password?>"
class="edit-profile__input"
/>
</div>
<div class="edit-profile__form-row">
<label for="bio" class="edit-profile__label">
Bio
</label>
<textarea name ="bio" class="edit-profile__textarea"><?php echo $bio?></textarea>
</div>
<div class="edit-profile__form-row">
<label for="email" class="edit-profile__label">
Email
</label>
<input
type="email"
class="edit-profile__input"
name ="email"
value = "<?php echo $email?>"
/>
</div>
<div class="edit-profile__form-row">
<label class="edit-profile__label"></label>
<input type="submit" name = "submit" value="Submit">
</div>
</form>
</section>
</main>
<footer class="footer">
<nav class="footer__nav">
<ul class="footer__list">
<li class="footer__list-item"><a href="#" class="footer__link">about us</a></li>
<li class="footer__list-item"><a href="#" class="footer__link">support</a></li>
<li class="footer__list-item"><a href="#" class="footer__link">blog</a></li>
<li class="footer__list-item"><a href="#" class="footer__link">press</a></li>
<li class="footer__list-item"><a href="#" class="footer__link">api</a></li>
<li class="footer__list-item"><a href="#" class="footer__link">jobs</a></li>
<li class="footer__list-item"><a href="#" class="footer__link">privacy</a></li>
<li class="footer__list-item"><a href="#" class="footer__link">terms</a></li>
<li class="footer__list-item"><a href="#" class="footer__link">directory</a></li>
<li class="footer__list-item"><a href="#" class="footer__link">language</a></li>
</ul>
</nav>
<span class="footer__copyright">© 2017 instagram</span>
</footer>
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
<script src="js/app.js"></script>
</body>
</html>