# URLLoader problems

**URL:** <https://forum.kirupa.com/t/urlloader-problems/246496>\
**Category:** flash\
**Created:** [December 11, 2007, 5:30pm UTC](https://forum.kirupa.com/t/urlloader-problems/246496 "2007-12-11T17:30:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![the\_lar](https://avatars.discourse-cdn.com/v4/letter/t/90ced4/32.png) [@the\_lar](https://forum.kirupa.com/u/the_lar)\
**Post date:** [December 11, 2007, 5:30pm UTC](https://forum.kirupa.com/t/urlloader-problems/246496/1 "2007-12-11T17:30:28Z")

</div>

Hopefully this is a relatively easy one! I’m using the following code to obtain some variables from a remote page:

```auto
public function URLLoaderDataFormatExample(event:MouseEvent)
        {
            var request:URLRequest = new URLRequest("http://www.<mydomain>/sample.txt");
            var variables:URLLoader = new URLLoader();
            variables.dataFormat = URLLoaderDataFormat.VARIABLES;
            variables.addEventListener(Event.COMPLETE, completeHandler);
            try
            {
                variables.load(request);
            } 
            catch (error:Error)
            {
                trace("Unable to load URL: " + error);
            }
        }
        private function completeHandler(ev:Event){
            var loader = URLLoader(ev.target);
            trace(loader.data.st);
        }

```

This works fine, until I change sample.txt to sample.php and use echo to print out my name variable pair. I get the following error with the PHP file:

Error: Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.  
at Error$/throwError()  
at [flash.net](http://flash.net)::URLVariables/decode()  
at [flash.net](http://flash.net)::URLVariables$iinit()  
at [flash.net](http://flash.net)::URLLoader/flash.net:URLLoader::onComplete()

My PHP code is simply: echo “?st=OK”;

What’s going wrong?

Cheers  
Kevin
