Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Apr 2006
    Posts
    231
    Thanks
    9
    Thanked 1 Time in 1 Post

    Passing Variables

    Hey all,

    I'm messing around with the mp3 player that is freely and widely avaiable at http://www.*******************. I've mixed everything up to match my likeing, and I'm stuck.

    Basically, the player works by taking in a playlist and playing what it has. It also comes with a readdir page, which I altered just about the whole thing. Anyway, when embeding the player, you declare the location of the playlist (my case readdir.php) via a flashvars attribute. In the readdir.php I have $artist=$_GET['id']; which should get the id when declared readdir.php?id=$id. It never passed teh $id. it stops at the ?id= (i found out when I viewed the source code on the browser).

    EMBED:
    Code:
    <embed allowScriptAccess="never"  src="http://www.jeshil.com/NV/music/mediaplayer.swf" menu="false" quality="high" width="280" height="200" name="mp3player" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="&config=http://www.jeshil.com/NV/music/config.xml&file=http://www.jeshil.com/NV/music/readdir.php?id=$id" wmode="transparent" border="0" />
    readdir.php
    Code:
    <?php
    $artist = $_GET[id];
    header("content-type:text/xml;charset=utf-8");
    echo ("<playlist version='1' xmlns='http://xspf.org/ns/0/'>\n");
    echo ("	<trackList>\n");
    if ($handle = opendir($artist)) {
    	while ($file = readdir($handle)){
    	 $pos = strpos($file, '.');
         $Name= ($pos === false) ? $file : substr($file, 0, $pos);
    			if ($file != '.' && $file != '..' && $file !='picture.gif' && $file !='index.php'){
    	echo ("		<track>\n");
    	echo ("			<title>$Name</title>\n");
    	echo ("			<location>http://jeshil.com/NV/music/$artist/$file</location>\n");
    	echo ("		</track>\n");
    }
    }}
    echo ("	</trackList>\n");
    echo ("</playlist>\n");
    ?>
    Anyone have any idea on how to pass the $id on to the readdir.php?

  • #2
    Master Coder mlseim's Avatar
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,389
    Thanks
    8
    Thanked 1,077 Times in 1,068 Posts
    Try this ...

    $artist = $_REQUEST[id];


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •