Hi there,
I want to build a php-based media-player which reads certain files from a directory (.mp3 for example). I have realised this in php so far, but
i don´t know how to submit/post/import variables from the command line/url
or rather from php´s resulting html INTO the playing-Koolmoves-swf, like
player.swf?dir=nameofsubdir/&file=nameofsound.mp3
In PHP for example i import and display variables this way:
<?php echo$_GET['subdir']; ?><?php echo$_GET['nameofsound']; ?>
... is there an analog function in KM?
Searching the forum leaded me to Loadvars which loads variables only
from a -separate file- ... this won´t help here.
any ideas / tips for me?
p.s.:
I have found these lines by necro searching the km-forum... but got no idea to handle..
"..
Try to use
loadVariables("yourpage.asp","GET"); (to receive) and
loadVariables("yourpage.asp","POST"); (to send)
instead of "getURL".
Also,don't forget that your dynamic page (ASP in this case) must be able to "format" as text array the output data:
var1=OWEN&var2=AUS&...&varn=END
cheers .."
if you put the variables in the "command line" as I showed you don't have to do anything in the flash movie to retrieve them. in the example above the flash movie would just have variables named var1 and var2 set.
to get variables with loadVariables command the server must send POST or GET vars to the flash.
in the PHP you send them with an echo command
echo "?var1=".$file;
etc........then in the flash you have a variable var1 that will equal the value of the PHP variable $file.
Ok looking at your code your PHP is ok except don't use txt1 as a variable name that will confuse you.
<a href="player.swf?path=<?php echo$_GET['pfad']; ?>&mytxt=JUSTATEST&file=<?php echo$_GET['file']; ?>">beta playerlink</a>
that's it!! with that the swf will have those variables path,mytxt,file To see them set your editbox variables to the same names and it will work fine.