suma237 Posted July 20, 2007 Share Posted July 20, 2007 hai, the output of this code is "track1.mp3track2.mp3track3.mp3",i want to include <a href> for each music file and on the click of each music file the song have to play. <? $dir = "song"; $dh = opendir($dir) or die ("could not open dir"); while ( !(($file = readdir($dh)) === false) ){ if ($file == "." || $file == "..") continue; if (eregi(".mp3",$file)){ echo $sheets[] .= $file; } } ?> Thanks Link to comment https://forums.phpfreaks.com/topic/60918-solved-how-to-include/ Share on other sites More sharing options...
JayBachatero Posted July 20, 2007 Share Posted July 20, 2007 Change echo $sheets[] .= $file; to echo '<a href="' . $file . '">' . $file . '</a> '; Link to comment https://forums.phpfreaks.com/topic/60918-solved-how-to-include/#findComment-303143 Share on other sites More sharing options...
suma237 Posted July 20, 2007 Author Share Posted July 20, 2007 Thanks.. How can i add the below function in the statment echo '<a href="' . $file . '">' . $file . '</a> '; function playmusic($music) { //function here } Please help me.Thanks a lot Link to comment https://forums.phpfreaks.com/topic/60918-solved-how-to-include/#findComment-303147 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.