-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedituser.php
More file actions
27 lines (22 loc) · 892 Bytes
/
edituser.php
File metadata and controls
27 lines (22 loc) · 892 Bytes
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
<?PHP
include "db_connect.php";
$sql = "SELECT * FROM user WHERE user_id = (?)";
$user_id = $_REQUEST["user_id"];
$stmt = $conn->prepare($sql);
$stmt->bind_param("i", $user_id);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
$row = $result->fetch_assoc();
}
?>
<form action="updateuser.php">
<label for="fname">First Name:</label></br>
<input type="text" id="fname" name="fname" value="<?PHP echo $row[firstname]?>"></br>
<label for="lname">Last Name:</label></br>
<input type="text" id="lname" name="lname" value="<?PHP echo $row[lastname]?>"></br>
<label for="username">Username:</label></br>
<input type="text" id="username" name="username" value="<?PHP echo $row[username]?>"></br>
<input type="hidden" id="user_id" name="user_id" value="<?PHP echo $row[user_id]?>"></br>
<input type="submit" value="Submit">
</form>