Puoi anche far scrivere a JavaScript la stringa di EMBED dentro un DIV con .innerHTML
In questa stringa il Valore di SRC sarà rappresentato da una Variabile (URL dell' mp3) che JS può prendere da un Array compilato nello SCRIPT come pure averla dal Database via PHP.
Ora bisogna vedere come questo dato PHP-MySQL vuoi farlo manifestare al reload della pagina; per cominciare, facciamo conto che entra come Value di un campo di testo:
codice:
<html>
<head>
<script type="text/javascript">
var brano;
function Play() {
brano = document.getElementById("delivered").value;
document.getElementById("audio").innerHTML='<embed id="musica" src="'+brano+'" type="" width="2" height="2" '+
'volume="100" autostart="true" loop="0" hidden="false"></embed>';
}
function Stop() {
document.getElementById("audio").innerHTML='';
}
</script>
</head>
<body>
<form>
mp3 URL : <input id="delivered" type="text">
<input value="esegui" type="button" onClick='Play(); '>
<input value="arresta" type="button" onClick='Stop(); '>
<div id="audio" style="display: ; width: ; height: ;"></div>
</form>
</body>
</html>
"clasku" ha già illustrato l' equivalente soluzione che fa scrivere la stringa al PHP.