...

View Full Version : Passing Variables



Erindesign
01-27-2007, 08:43 PM
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:


<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

<?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?

mlseim
01-28-2007, 03:44 AM
Try this ...

$artist = $_REQUEST[id];



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum