tags:

views:

104

answers:

4

This is my site. When i will select songs for playing player.php file will open and it will play the songs selected.

Everything working fine,but the problem is when o will go back and select another songs it is opening one more player window. please help me.

I want only one player window has to be opened even i select other songs also. to check the problem go to this url and play the songs once

player.php

createElement("playlist");
$dom->appendChild($root);
$root->setAttribute('version', "1");
$root->setAttribute('xmlns', "http://xspf.org/ns/0/");
$rootnext = $dom->createElement("trackList");
$root->appendChild($rootnext);
foreach ($song as $counter) {
    $tokens = ",";
    $tokenized = strtok($counter, $tokens);
// create child element

$song = $dom->createElement("track");
$rootnext->appendChild($song);
$song1 = $dom->createElement("creator");
$song->appendChild($song1);
$text = $dom->createTextNode("www.musicking.in");
$song1->appendChild($text); 
$song1 = $dom->createElement("title");
$song->appendChild($song1);
// create text node
$text = $dom->createTextNode($tokenized);
$song1->appendChild($text); 
$tokenized = strtok($tokens);
$song1 = $dom->createElement("location");
$song->appendChild($song1);
$text = $dom->createTextNode($tokenized);
$song1->appendChild($text); 

}
// save 
$dom->save("playlist.xml");
?>

playlist.xml


www.musicking.inDuryodhana's dialouge1/Ntr dialouges/duryodhana's dialouge.mp3www.musicking.inDuryodhana's dialouge2/Ntr dialouges/dvsk_dialogues-10.mp3www.musicking.inDuryodhana's dialouge3/Ntr dialouges/dvsk_dialogues-3.mp3www.musicking.inDuryodhana's dialouge4/Ntr dialouges/dvsk_dialogues-4.mp3www.musicking.inDuryodhana's dialouge5/Ntr dialouges/dvsk_dialogues-5.mp3www.musicking.inDuryodhana's dialouge6/Ntr dialouges/dvsk_dialogues-6.mp3www.musicking.inDuryodhana's dialouge7/Ntr dialouges/dvsk_dialogues-7.mp3www.musicking.inDuryodhana's dialouge8/Ntr dialouges/dvsk_dialogues-8.mp3www.musicking.inDuryodhana's dialouge9/Ntr dialouges/dvsk_dialogues-9.mp3www.musicking.inDuryodhana's dialouge10/Ntr dialouges/dvsk_dialogues-11.mp3www.musicking.inDuryodhana's dialouge11/Ntr dialouges/karna's dialouge.mp3
+4  A: 

I think that it opens a new window because you have specified target='_blank' in the form. Try to use different target (i.e. target="player").

Alekc
A: 

Hello,

I Agree with Alekc.

For a better user experience you should also not open a new window but put the player div inside the page in iframe and then simple change the src of the iframe (easy with javascript or jquery) to your new playlist. Most of web users have popup blocking scripts, so the player may even not display.

Putting the player inside the page improves your design and usability.

Disco
if i will put a player in the same window player will stop playing songs when user go to other page for othe songs . so my player should be open in other window.
musicking123
+1  A: 

if i will put a player in the same window player will stop playing songs when user go to other page for othe songs . so my player should be open in other window.

musicking123
+1  A: 

Alekc has it right.

Your form code is this:

<form method="post" action="/player.php" target="_blank">

You should change the target to something like player. This change will still cause the player to open in a new window, but that window will be uniquely named.

<form method="post" action="/player.php" target="player">

Then, when a user clicks on "Play Selected," instead of opening another window, it will load into the old player.

St. John Johnson
thnk u ...........its working.......
musicking123