-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path09-edit.php
More file actions
27 lines (25 loc) · 757 Bytes
/
09-edit.php
File metadata and controls
27 lines (25 loc) · 757 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
$conn = require '09-connection.php';
$id = $_GET["id"];
$stmt = $conn->prepare("SELECT * FROM users WHERE id = ?");
$stmt->bind_param("i", $id);
$stmt->execute();
$result = $stmt->get_result();
$user = $result->fetch_assoc();
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Add User</title>
</head>
<body>
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>?>" method="post">
<input type="text" name="name" value="<?=$user["name"]?>">
<input type="email" name="email" value="<?=$user["email"]?>">
<input type="submit" value="send-user">
</form>
<p><a href="javascript:history.back()"><< Back</a></p>
</body>
</html>