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 Quote Link to comment 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> '; Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.