hjkhjkjhkhjkgjghjhgjhgjghjhghjghjhgjjnbvnvbnvk
bnmbnmbnhjkhjkhjkhjktyutyutyuytutyutyutyhgjgjghjgjghjguytutyry
/
home
/
wjcvelqp
/
public_html
/
Upload FileeE
HOME
<?php require_once 'config/database.php'; if (isset($_GET['id'])) { $id = (int)$_GET['id']; // Get the song $stmt = $pdo->prepare("SELECT * FROM music WHERE id = ? AND status = 'approved'"); $stmt->execute([$id]); $song = $stmt->fetch(); if ($song) { // Increase download count $stmt = $pdo->prepare("UPDATE music SET download_count = download_count + 1 WHERE id = ?"); $stmt->execute([$id]); // Force download the file $file = 'uploads/' . $song['audio_file']; if (file_exists($file)) { header('Content-Description: File Transfer'); header('Content-Type: audio/mpeg'); header('Content-Disposition: attachment; filename="' . basename($song['title']) . '.mp3"'); header('Expires: 0'); header('Cache-Control: must-revalidate'); header('Pragma: public'); header('Content-Length: ' . filesize($file)); readfile($file); exit; } } } // If something goes wrong, redirect back header("Location: music.php"); exit; ?>