hjkhjkjhkhjkgjghjhgjhgjghjhghjghjhgjjnbvnvbnvk
bnmbnmbnhjkhjkhjkhjktyutyutyuytutyutyutyhgjgjghjgjghjguytutyry
/
home
/
wjcvelqp
/
biblog
/
Upload FileeE
HOME
<?php require_once 'config/database.php'; if ($_POST) { $title = trim($_POST['title']); $artist = trim($_POST['artist']); $description = trim($_POST['description'] ?? ''); $audio_file = ''; if (isset($_FILES['audio']) && $_FILES['audio']['error'] == 0) { $ext = pathinfo($_FILES['audio']['name'], PATHINFO_EXTENSION); $audio_file = time() . '_audio.' . strtolower($ext); move_uploaded_file($_FILES['audio']['tmp_name'], 'uploads/' . $audio_file); } $cover_image = ''; if (isset($_FILES['cover']) && $_FILES['cover']['error'] == 0) { $ext = pathinfo($_FILES['cover']['name'], PATHINFO_EXTENSION); $cover_image = time() . '_cover.' . strtolower($ext); move_uploaded_file($_FILES['cover']['tmp_name'], 'uploads/' . $cover_image); } $stmt = $pdo->prepare("INSERT INTO music (title, artist, audio_file, cover_image, description, status) VALUES (?, ?, ?, ?, ?, 'pending')"); $stmt->execute([$title, $artist, $audio_file, $cover_image, $description]); echo "<h2 class='text-center mt-20 text-green-700'>Song submitted successfully! Waiting for admin approval.</h2>"; echo "<p class='text-center'><a href='music.php' class='text-green-700 underline'>← Back to Music Page</a></p>"; } ?>