D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
home
/
markniuj
/
bazmeasar.com
/
pdf
/
Filename :
edit_record.php
back
Copy
<?php include "../config.php"; ?> <!DOCTYPE html> <html> <head> <title>Edit PDF Record</title> <meta content="width=device-width, initial-scale=1.0" name="viewport"> <link href="table.css" rel="stylesheet"> <!-- You can link your CSS file here --> <link href="css.css" rel="stylesheet"> </head> <body> <h1>Edit PDF Record</h1> <?php // Check if an ID is provided in the URL if (isset($_GET['id'])) { $id = $_GET['id']; // Retrieve the PDF record based on the provided ID $sql = "SELECT * FROM pdf_books WHERE id = $id"; $result = $conn->query($sql); if ($result->num_rows == 1) { $row = $result->fetch_assoc(); ?> <form action="update_record.php" method="POST"> <input type="hidden" name="id" value="<?php echo $row['id']; ?>"> <label for="book_name">Book Name:</label> <input type="text" name="book_name" value="<?php echo $row['book_name']; ?>" required><br><br> <label for="book_author">Book Author:</label> <input type="text" name="book_author" value="<?php echo $row['book_author']; ?>" required><br><br> <label for="description">Description:</label> <textarea name="description" rows="4" required><?php echo $row['description']; ?></textarea><br><br> <label for="pdf_category">PDF Category:</label> <input type="text" name="pdf_category" value="<?php echo $row['pdf_category']; ?>" required><br><br> <input type="submit" value="Update Record"> </form> <?php } else { echo "Record not found."; } // Close the database connection $conn->close(); } else { echo "Invalid request. Please provide a valid record ID."; } ?> </body> </html>