Page 1 of 1

NEED HELP !!!!!!!!!!!!! NEW TP PHP

Posted: Sun Nov 11, 2007 2:44 pm
by sushantkaura
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


hey guys , 
i [s]m[/s] [size=150][color=green]am[/color][/size] new to php , so having a little trouble,
please help me out
i [s]m[/s] [size=150][color=green]am[/color][/size] using a player to play songs whose statement is written in JAVA SCRIPT which is in my player.php

[syntax="javascript"]<script type="text/javascript">
   var so = new SWFObject("playerSingle.swf", "mymovie", "192", "67", "7", "#FFFFFF");
   so.addVariable("autoPlay", "yes");
   *so.addVariable("soundPath", "song.mp3");
   so.write("flashPlayer");
</script>
i want to place a different url which is in my variable $url,in php rather than song.mp3(* shown)
please tell me how to do it...
[s]thnx[/s] thanks in advance.....................
sushant kaura
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:11. Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.

Some examples of what not to do are ne1, any1 (anyone); u (you); ur (your or you're); 2 (to too); prolly (probably); afaik (as far as I know); etc.
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.

feyd | Please use[/syntax]

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Sun Nov 11, 2007 6:14 pm
by s.dot
You can use php to output javascript.

Code: Select all

//array of songs
$songs = array('song1.mp3', 'song2.mp3', 'song3.mp3');

//mix them up
shuffle($songs);

//write the javascript

echo 'so.addVariable("soundPath", \'' . $songs[0] . '\');';