This question already has an answer here:
this is my code:
<?php
$dir = "songs/";
$songs = scandir($dir);
$i = rand(2, sizeof($songs)-1);
?>
<audio src="songs/<?php echo $songs[$i]; ?>" id="audio_player_id" autoplay controls="controls"></audio>
This code get random file from a folder and it's working, but there is an error. The error: Notice: Undefined variable: random_row
How to fix whatever it is and whats the problem?
Aucun commentaire:
Enregistrer un commentaire