Page 1 of 1

How to get player in one window only?

Posted: Mon Feb 23, 2009 2:42 am
by gadadasusrikanth

Code: Select all

 
<html>
<body>
<?php
 
if(isset($_POST["song"])&& $_POST['song'] != "") 
    {
        $song = $_POST["song"];
    }
        
    else {$song=array();} 
         
for ($i="0"; $i<count($song); $i++) { 
 
 
//echo  $song[$i];
}
 
 
 
         
         
 
//start of new php codep
 
// create doctype
 
//$array = array(
  //  'song.mp3','song.mp3','song.mp3',
    
    
//);
 
$dom = new DOMDocument("1.0");
 
// display document in browser as plain text 
// for readability purposes
header("Content-Type: text/plain");
// create root element
$root = $dom->createElement("xml");
$dom->appendChild($root);
$i = "1";
foreach ($song as $counter) {
// create child element
 
$song = $dom->createElement("track");
$root->appendChild($song);
 
$song1 = $dom->createElement("path");
$song->appendChild($song1);
// create text node
$text = $dom->createTextNode($counter);
$song1->appendChild($text); 
 
$song1 = $dom->createElement("title");
$song->appendChild($song1);
 
$text = $dom->createTextNode("song ".$i);
$song1->appendChild($text); 
$i++;
}
 
 
// save and display tree
//echo $dom->saveXML();
$dom->save("playlist.xml");
 
 
 ?>
 
<script type="text/javascript" src="swfobject.js">
</script>
        
<div id="flashPlayer">
  This text will be replaced by the flash music player.
</div>
 
<script type="text/javascript">
   var so = new SWFObject("playerMultipleList.swf", "mymovie", "295", "200", "7", "#FFFFFF");  
   so.addVariable("autoPlay","yes")
   so.addVariable("playlistPath","playlist.xml")
   so.write("flashPlayer");
</script>
</body>
</html>
 
 
 
 
This is the code for my player which will automatically generate playlist.xml file according to the songs selected by the user. i kept this file as player.php in my root folder and in the form i gave so this player is opening ang playing songs accoprding to selected.

But the problem is when the user again select different songs during previously selected songs are playing in the player in new window ,the new songs selected are opening in one more window,ie now two player windows are opened. Actually i want the second selected songs will play in the same window which is already opened.

Please help me. u can check wats happening in my site by playing songs,http://www.musicking.in/hindi-songs/69.html