# Please help, urgent! What's wrong? Error #2101 URLVariables

**URL:** <https://forum.kirupa.com/t/please-help-urgent-whats-wrong-error-2101-urlvariables/298069>\
**Category:** flash\
**Created:** [October 13, 2009, 11:05am UTC](https://forum.kirupa.com/t/please-help-urgent-whats-wrong-error-2101-urlvariables/298069 "2009-10-13T11:05:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![frankichiro](https://avatars.discourse-cdn.com/v4/letter/f/b9bd4f/32.png) [@frankichiro](https://forum.kirupa.com/u/frankichiro)\
**Post date:** [October 13, 2009, 11:05am UTC](https://forum.kirupa.com/t/please-help-urgent-whats-wrong-error-2101-urlvariables/298069/1 "2009-10-13T11:05:05Z")

</div>

Aaaargh! No matter what I do, I always get the same error:

Error opening URL ‘[http://www.mydomain.com/return.php](http://www.mydomain.com/return.php)’  
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()  
at [flash.net](http://flash.net)::URLLoader/onComplete()

**Here’s my code:**

```php
var urlVariables:URLVariables = new URLVariables()
urlVariables.test1 = 'bacon';
urlVariables.test2 = 'kittens';

var urlRequest:URLRequest=new URLRequest('http://www.mydomain.com/return.php');
urlRequest.method = URLRequestMethod.POST;
urlRequest.data = urlVariables;

var urlLoader:URLLoader = new URLLoader();
urlLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
urlLoader.addEventListener(Event.COMPLETE, loadComplete);
urlLoader.addEventListener(IOErrorEvent.IO_ERROR, loadIOError);
urlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, loadSecurityError);

function loadComplete(e:Event):void {
	
	trace(e.target.data);
	
}

function loadIOError(event:IOErrorEvent):void {

	trace("IOError: "+event);
	
}

function loadSecurityError(event:SecurityErrorEvent):void {
	
	trace("SecurityError: "+event);
	
}

try {
	
	urlLoader.load(urlRequest);
	
} catch (error:ArgumentError) {
	
	trace("ArgumentError: "+error);
	
} catch (error:MemoryError) {
	
	trace("MemoryError: "+error);
	
} catch (error:SecurityError) {
	
	trace("SecurityError: "+error);
	
} catch (error:TypeError) {
	
	trace("TypeError: "+error);
	
} catch (error:Error) {
	
	trace("Unknown Error: "+error);
	
}

```

**My PHP file looks like this:**

```php
<?PHP
	
	$array = array();
	
	foreach ($_POST as $key=>$value) {
		
		array_push($array, $key.'='.urlencode($value));
		
	}
	
	$string = implode('&', $array);
	
	echo $string;
	
?>

```

Any advice?

/ Frank
