Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'db.php';
- $id = $_GET['id'];
- $sql = "SELECT * FROM users WHERE id=$id";
- $result = $conn->query($sql);
- $user = $result->fetch_assoc();
- ?>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Update User</title>
- <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
- </head>
- <body>
- <div class="container mt-5">
- <h2 class="mb-4">Update User</h2>
- <form action="update_process.php" method="post">
- <input type="hidden" name="id" value="<?php echo $user['id']; ?>">
- <div class="mb-3">
- <label for="name" class="form-label">Name</label>
- <input type="text" class="form-control" id="name" name="name" value="<?php echo $user['name']; ?>" required>
- </div>
- <div class="mb-3">
- <label for="email" class="form-label">Email</label>
- <input type="email" class="form-control" id="email" name="email" value="<?php echo $user['email']; ?>" required>
- </div>
- <button type="submit" class="btn btn-primary">Update User</button>
- </form>
- </div>
- </body>
- </html>
Add Comment
Please, Sign In to add comment