code.poet
Group: Members
Joined: 16 Dec, 2005
Posts: 64
My Contributions
Hi there!
I have created a playlist with multiple checkbox for a jukebox.
now I want to play this or these song in a player that I customized that will hld the value of those selected track.
my files are as follows>>>
my first file>> playlist.php
***[
<form name=fp action="player. php" method="POST" enctype="audio/mpegurl">
<table width=100% align=left>
<?
$query="select * from musiclibrary where music_no='$id' order by music_no desc";
$result=mysql_q uery($query);
$count=mysql_nu m_rows($result) ;
if( empty( $count ) )
{
echo "<BR> &nbs p;Song is not available<BR>&n bsp; in this category.";
}
else
{
while($rows=mys ql_fetch_array( $result)){
?> <tr>
<td width=25% align=center>
<input type=checkbox name="track[]" value="<? echo $rows['music_no']; ?>">
</td>
<td width=75% align=left>
<? echo $rows['music_name']; var_dump($rows['music_no']);?>
</td>
</tr>
<?
}
}
?>
</table>
</div>
<div id="Layer6" style="position :absolute; width:55; height:23; z-index:5; left: 208px; top: 249px">
<input type="hidden" name="track[]" value="<? echo $rows['music_no']; ?>">
<input type=image name=play src="../images/button_playlist .gif" width="55" height="23" border=0>
</div>
</form>
]***
My second file >> player.php
***]
<?
include "../admin/include/db.php";
$file=$_GET['track'];
$result = mysql_query( "SELECT music_no, music_name, file_name FROM musiclibrary where music_no='$file '" );
//$count = mysql_num_rows( $result );
if ($result){
while($row = mysql_fetch_arr ay($result, MYSQL_NUM))
{
$result_array[] = $mdir."/".$row[3]."\n";
}
mysql_free_resu lt( $result );
}else{
echo'error';
}
?>
<html>
<head>
<title>Player </title>
</head>
<body bgcolor="#FFFFF F">
<title>player </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaS cript">
<!--
function MM_reloadPage(i nit) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Net scape")&&(parse Int(appVersion) ==4)) {
document.MM_pgW =innerWidth; document.MM_pgH =innerHeight; onresize=MM_rel oadPage; }}
else if (innerWidth!=do cument.MM_pgW || innerHeight!=do cument.MM_pgH) location.reload ();
}
MM_reloadPage(t rue);
// -->
<!--</script>
</head>
<div id="Layer1" style="position :absolute; width:300; height:300; z-index:2; left: -2px; top: -2px; background-color: #000000; layer-background-color: #000000; border: 1px none #000000">
<OBJECT ID="MediaPlayer " WIDTH=300 HEIGHT=300
classid="clsid: 22D6f312-B0F6-11D0-94AB-0080C74C7E95"
STANDBY="Loadin g Media Player components"
TYPE="applicati on/x-oleobject"
codebase="http://activex.microso ft.com">
<PARAM NAME = "autostart" VALUE = "True" >
<PARAM NAME = "filename" VALUE = "<?print $result_array [i am confuse abuot this value];?>" >
</OBJECT>
</div>
</body>
</html>
<script>
]***
my table format is like .....
CREATE TABLE `musiclibrary` (
`music_no` int(11) NOT NULL auto_increment,
`music_name` varchar(100) default NULL,
`file_name` varchar(100) default NULL,
`music_day` decimal(10,0) default NULL,
`cat_id` decimal(10,0) default NULL,
PRIMARY KEY (`music_no`),
UNIQUE KEY `music_no` (`music_no`),
KEY `cat_id` (`cat_id`)
);
please tel me how'll I do that!!
Regards