ЁЯУБ File Manager
Editing:
/home/wvl7mof7402e/public_html/remindyourdata.live/admin/edit_agent.php
<?php include "dbconnect.php"; // рдПрдЬреЗрдВрдЯ рдХреА рдЬрд╛рдирдХрд╛рд░реА рдкреНрд░рд╛рдкреНрдд рдХрд░реЗрдВ if (isset($_GET['id'])) { $id = $_GET['id']; $stmt = $con->prepare("SELECT * FROM agents WHERE id = ?"); $stmt->bind_param("i", $id); $stmt->execute(); $result = $stmt->get_result(); $agent = $result->fetch_assoc(); $stmt->close(); } // рдПрдЬреЗрдВрдЯ рдХреА рдЬрд╛рдирдХрд╛рд░реА рдЕрдкрдбреЗрдЯ рдХрд░реЗрдВ if ($_SERVER["REQUEST_METHOD"] == "POST") { $name = $_POST['name']; $father_name = $_POST['father_name']; $qualification = $_POST['qualification']; $mobile_no = $_POST['mobile_no']; $email_id = $_POST['email_id']; $address = $_POST['address']; $city = $_POST['city']; $state = $_POST['state']; $message = $_POST['message']; $adharno = $_POST['adharno']; // тЬЕ рдЖрдзрд╛рд░ рдирдВрдмрд░ $pancard = $_POST['pancard']; // тЬЕ рдкреИрдирдХрд╛рд░реНрдб рдирдВрдмрд░ $stmt = $con->prepare("UPDATE agents SET name=?, father_name=?, qualification=?, mobile_no=?, email_id=?, address=?, city=?, state=?, adharno=?, pancard=?, message=? WHERE id=?"); $stmt->bind_param("sssssssssssi", $name, $father_name, $qualification, $mobile_no, $email_id, $address, $city, $state, $adharno, $pancard, $message, $id); if ($stmt->execute()) { header("Location: agentlist.php?success=updated"); exit(); } else { echo "<div class='alert alert-danger'>тЭМ Error updating agent!</div>"; } $stmt->close(); } ?> <!DOCTYPE html> <html> <head> <title>Edit Agent</title> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css"> </head> <body> <div class="container"> <h3 class="text-center">Edit Agent</h3> <form method="POST"> <input type="text" name="name" value="<?= htmlspecialchars($agent['name']) ?>" class="form-control" required> <input type="text" name="father_name" value="<?= htmlspecialchars($agent['father_name']) ?>" class="form-control"> <input type="text" name="qualification" value="<?= htmlspecialchars($agent['qualification']) ?>" class="form-control"> <input type="text" name="mobile_no" value="<?= htmlspecialchars($agent['mobile_no']) ?>" class="form-control" required> <input type="email" name="email_id" value="<?= htmlspecialchars($agent['email_id']) ?>" class="form-control" required> <input type="text" name="adharno" value="<?= htmlspecialchars($agent['adharno']) ?>" class="form-control" required> <!-- тЬЕ рдЖрдзрд╛рд░ рдирдВрдмрд░ --> <input type="text" name="pancard" value="<?= htmlspecialchars($agent['pancard']) ?>" class="form-control" required> <!-- тЬЕ рдкреИрдирдХрд╛рд░реНрдб рдирдВрдмрд░ --> <textarea name="address" class="form-control"><?= htmlspecialchars($agent['address']) ?></textarea> <input type="text" name="city" value="<?= htmlspecialchars($agent['city']) ?>" class="form-control"> <input type="text" name="state" value="<?= htmlspecialchars($agent['state']) ?>" class="form-control"> <textarea name="message" class="form-control"><?= htmlspecialchars($agent['message']) ?></textarea> <button type="submit" class="btn btn-primary mt-2">Update</button> </form> </div> </body> </html>
Save
Cancel