Jump to content

music player


jasonhardwick

Recommended Posts

what i am trying to do is embed a music player in my php page. The mp3s are uploaded by users and the mp3 links are in my sql database and files are stored in my "files" folder. I have no idea on where to start, should i use flash or java or another??? i really dont know what would be best. any ideas or easy to follow tutorials would be a great help or if anyone has done anything like this.

 

thanks in advance,

J

Link to comment
https://forums.phpfreaks.com/topic/105597-music-player/
Share on other sites

EDIT: Ohh i get it now :P Yeah sounds like a job for flash ;)

 

What i did was, make a file called view-track.php or anything else

 

<?
$id = $_GET['id'];
$dbcnx = mysql_connect("localhost", "root", "password"); mysql_select_db("database");
          $result = @mysql_query("SELECT * FROM tracks WHERE id=$id");
     if (!$result)   {     echo("<b>Error performing query: " . mysql_error() . "</b>");
       exit();          }    while ($row = mysql_fetch_array($result) )  {
	$id = $row["id"];
	$artist = $row["artist"];
	$song = $row["song"];
echo("<center><font size=1 face=verdana>Listening To $song by $artist");  
?>
<br><br><embed src="<?echo"$artist - $song";?>.mp3" 
width="250" height="40" autostart="true" loop="false"> 
</embed>
<?}?>

Link to comment
https://forums.phpfreaks.com/topic/105597-music-player/#findComment-540959
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.