# Passing a PHP variable into URLrequest

**URL:** <https://forum.kirupa.com/t/passing-a-php-variable-into-urlrequest/287112>\
**Category:** flash\
**Created:** [April 26, 2009, 4:48pm UTC](https://forum.kirupa.com/t/passing-a-php-variable-into-urlrequest/287112 "2009-04-26T16:48:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomh88](https://avatars.discourse-cdn.com/v4/letter/t/ce7236/32.png) [@tomh88](https://forum.kirupa.com/u/tomh88)\
**Post date:** [April 26, 2009, 4:48pm UTC](https://forum.kirupa.com/t/passing-a-php-variable-into-urlrequest/287112/1 "2009-04-26T16:48:37Z")

</div>

Hi

I have a php file (current\_mp3.php) that prints:

&mp3url=http://www.url.com/mp3.mp3

Which I believe is the right format to pass the variable in.

My AS looks like this:

```auto

var myData = new LoadVars();
myData.load("http://www.url.com/path/to/current_mp3.php");

var music:Sound = new Sound(new URLRequest("myData.mp3url"));
var sc:SoundChannel;
var isPlaying:Boolean = false;
var pos:Number = 0;
now_playing.visible=false;
paused.visible=false;
start.visible=true;

pause_btn.addEventListener(MouseEvent.CLICK, pauseMusic);

function pauseMusic(e:Event):void
{
    if (isPlaying)
    {
        pos = sc.position;
        sc.stop();
        isPlaying = false;
        now_playing.visible=false;
        paused.visible=true;
        start.visible=false;
    }
}

play_btn.addEventListener(MouseEvent.CLICK, playMusic);

function playMusic(e:Event):void
{
    if (!isPlaying)
    {
        sc = music.play(pos);
        isPlaying = true;
        now_playing.visible=true;
        paused.visible=false;
        start.visible=false;

    }
}

```

…but it doesn’t seem to be working. I’m not sure what’s going on (I’m not experienced with AS). Any help very much appreciated!!
