X7ROOT File Manager
Current Path:
/home/u742491609/domains/apca.org.in/public_html/admin/short-term
home
/
u742491609
/
domains
/
apca.org.in
/
public_html
/
admin
/
short-term
/
??
..
??
admin_panel.php
(5.61 KB)
??
config.php
(611 B)
??
create_database.php
(2.53 KB)
??
delete_image.php
(201 B)
??
delete_section.php
(218 B)
??
edit_image.php
(1.63 KB)
??
edit_section.php
(4.22 KB)
??
gallery.php
(2.33 KB)
??
sidebar.php
(4.45 KB)
??
upload.php
(1.88 KB)
??
upload_additional_images.php
(1.24 KB)
??
uploads
??
uploads1746007705_DSC13.JPG
(6.51 MB)
??
uploads1746007705_DSC14.JPG
(7.1 MB)
??
uploads1746007705_DSC15.JPG
(7.3 MB)
Editing: edit_image.php
<?php require 'config.php'; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $id = $_POST['id']; $image_name = $_FILES['image']['name']; $image_tmp_name = $_FILES['image']['tmp_name']; $image_path = 'uploads/' . $image_name; move_uploaded_file($image_tmp_name, $image_path); $stmt = $pdo->prepare("UPDATE images5 SET image_path = :image_path WHERE id = :id"); $stmt->execute(['image_path' => $image_path, 'id' => $id]); header('Location: admin_panel.php'); } else { $id = $_GET['id']; $stmt = $pdo->prepare("SELECT * FROM images5 WHERE id = :id"); $stmt->execute(['id' => $id]); $image = $stmt->fetch(PDO::FETCH_ASSOC); } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Edit Image</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"> </head> <body> <div class="container mt-5"> <h1>Edit Image</h1> <form action="edit_image.php" method="POST" enctype="multipart/form-data"> <input type="hidden" name="id" value="<?php echo $image['id']; ?>"> <div class="form-group"> <label for="image">Image:</label> <input type="file" name="image" class="form-control" required> </div> <button type="submit" class="btn btn-primary">Update</button> </form> </div> <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.2/dist/js/bootstrap.bundle.min.js"></script> </body> </html>
Upload File
Create Folder