I'm creating a portfolio website for my music and want to allow users to play my songs without them being able to see the source/download the mp3 files.
I'm using PHP for this project and loading the files via HTTP headers.
<?php
$mp3 ='72vox.mp3';
if(file_exists($mp3)) {
header('Content-Type: audio/mpeg');
header('Content-Disposition: inline; filename="mp3_file.mp3"');
header('Content-length: '. filesize($mp3));
header('Cache-Control: no-cache');
header('Content-Transfer-Encoding: chunked');
readfile($mp3);
exit;
}
?>
When the page loads, my mp3 plays. However, I can't seem to figure out how to display any HTML on the page (and more importantly, how to place the audio controls in a div).
Thank you for any help in advance