-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedit.php
60 lines (57 loc) · 2.33 KB
/
edit.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
<?php
session_start();
include_once "php/config.php";
if(!isset($_SESSION['unique_id'])){
header("location: login.php");
}
?>
<?php include_once "header.php"; ?>
<body>
<?php
$user_id = mysqli_real_escape_string($conn, $_SESSION['unique_id']);
$sql = mysqli_query($conn, "SELECT * FROM users WHERE unique_id = {$user_id}");
if(mysqli_num_rows($sql) > 0){
$row = mysqli_fetch_assoc($sql);
}
?>
<div class="wrapper">
<section class="form edit" style="padding-top: 10px;">
<header style="border-bottom: 1px solid #e6e6e6; display: flex; align-items: center; padding-bottom: 0px; margin-top:0px;">
<a href="users.php" style="color: #333; font-size: 18px; float: left;"><i class="fas fa-arrow-left"></i></a>
<span style="margin: 20px; font-size: 18px; font-weight: 500;">Edit Profile</span>
</header>
<form action="#" method="POST" enctype="multipart/form-data" autocomplete="off">
<div class="error-text"></div>
<div class="name-details">
<div class="field input">
<label>First Name</label>
<input type="text" name="fname" placeholder="First name" value="<?php echo $row['fname'] ?>" required>
</div>
<div class="field input">
<label>Last Name</label>
<input type="text" name="lname" placeholder="Last name" value="<?php echo $row['lname'] ?>" required>
</div>
</div>
<div class="field input">
<label>About</label>
<input type="text" name="about" placeholder="Enter About Info" value="<?php echo $row['about'] ?>" required>
</div>
<div class="field input">
<label>Password</label>
<input type="password" name="password" value="<?php echo $_SESSION['pass'] ?>" placeholder="Enter new password" required>
<i class="fas fa-eye"></i>
</div>
<div class="field image">
<label>Select Image</label>
<input type="file" name="image" accept="image/x-png,image/gif,image/jpeg,image/jpg">
</div>
<div class="field button">
<input type="submit" name="submit" value="Update Profile">
</div>
</form>
</section>
</div>
<script src="javascript/pass-show-hide.js"></script>
<script src="javascript/edit.js"></script>
</body>
</html>