...

View Full Version : insert variables to php page



buildrebuild
12-27-2006, 03:55 PM
Hi all,
I'm having a problem. I want to have a single page holding this code for a Flash mp3 player...

<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','width','150','height','20','src','../singlemp3player?file=http://www.buildrebuild.com/audio/dirtyDeeds2.mp3','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','../singlemp3player?file=http://www.buildrebuild.com/audio/dirtyDeeds2.mp3' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="150" height="20">
<param name="movie" value="../singlemp3player.swf?file=http://www.buildrebuild.com/audio/dirtyDeeds2.mp3" />
<param name="quality" value="high" />
<embed src="../singlemp3player.swf?file=http://www.buildrebuild.com/audio/dirtyDeeds2.mp3" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="150" height="20"></embed>
</object></noscript>


What I want to do is send variables to this page from a link so I can change the "?file=http://www.buildrebuild.com/audio/dirtyDeeds2.mp3" variable each time so a different mp3 loads.
I know you can write out code on the fly with javascripts getElementById etc but can you do it with PHP?

The linked page will be in an iframe, so link would be...

<iframe name="hydroponicPlayer" id="hydroponicPlayer" width="150" height="20" src="player.html?file=http://www.buildrebuild.com/audio/dirtyDeeds2.mp3" frameborder="0" scrolling="no"></iframe>

and...


<iframe name="hydroponicPlayer" id="hydroponicPlayer" width="150" height="20" src="player.html?file=http://www.buildrebuild.com/audio/yerMa.mp3" frameborder="0" scrolling="no"></iframe>


player.html will always be the same page to be loaded into the "hydroponicPlayer" iframe...it's just the mp3 variable that needs changed on each link.

Any help?...if you understood what I've rambled on about.
Thx
CB

danielwarner
12-27-2006, 11:32 PM
a bit more on the question asked...do you mean all you want to do is change the iframe url to a random .mp3 doc?

also...if you do mean the above, are all the mp3's held in a database?

buildrebuild
12-28-2006, 09:52 AM
Hi,
Got it sorted. The client isn't worried about the location of the MP3 being made available to the public so I just passed a variable in the URL link to the iframe and used $_GET['track']; in the iframe to receive the variable "track".

Thx for the reply anyways,

Best
CB

I really want to get a PHP and MySQL running though and do all my coding more securely in the near future.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum