I am trying to achieve the following : I want to start a selected song on the rpi from a web interface.
I can play the song through exec
exec("mpg123 /var/www/html/Sounds/Zelda.mp3",$status);
and I can create a list dynamically through /var/www/html/Sounds
<?php
$arr_files = scandir("/var/www/html/Sounds/");
echo "<select name =\"songlist\" size=\"5\">";
foreach ($arr_files as $value){
echo "<option value=\"$value\">$value</option>";
}
echo "</select>"
?>
How would I go about in order to take the selected song from the html select 'songlist' and then play it using the exec command by clicking a button?
So far, the only thing I am finding is how to play a song on the client, not on the server side.
Hopefully this is clear enough. Please let me know if more information is required.
Thanks.
edit : I would like to say that I am a total newbie with PHP/HTML, so explanations would be welcomed as well.