Need help to return variables into Flash AS 3.0

Using this Actionscript:



var loader=new URLLoader();
var loaderURL=new URLRequest("test.php");
var loaderVars=new URLVariables();

loaderVars.nameTxt="someName";

loaderURL.method=URLRequestMethod.POST;
loader.dataFormat=URLLoaderDataFormat.VARIABLES;

loaderURL.data=loaderVars;
loader.load(loaderURL);

loader.addEventListener(Event.COMPLETE,completed);

function completed(e):void{
 trace(e.target.data.output);
}


and this php

<?php
$var=$_POST['nameTxt'];
echo "&output=$var";
?>

flash traces this:


$var";
?>

Can anyone help me how to recieve variables from PHP correctly. This code is displaying everything after that &output= and not displaying the variable but $var itself.

Please tell a way to recieve multiple variables…:puzzle: