# Var from flash to php and back

**URL:** <https://forum.kirupa.com/t/var-from-flash-to-php-and-back/308225>\
**Category:** Uncategorized\
**Created:** [April 19, 2010, 12:09pm UTC](https://forum.kirupa.com/t/var-from-flash-to-php-and-back/308225 "2010-04-19T12:09:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lillo\_\_hotmail](https://avatars.discourse-cdn.com/v4/letter/l/ad7895/32.png) [@lillo\_\_hotmail](https://forum.kirupa.com/u/lillo__hotmail)\
**Post date:** [April 19, 2010, 12:09pm UTC](https://forum.kirupa.com/t/var-from-flash-to-php-and-back/308225/1 "2010-04-19T12:09:59Z")

</div>

I’m have an input textfield that I want to send to php and then I want the php to generate a xml that I can load back into flash. If I use a static var in php flash manage to load the xml but as soon as I enable the “$user = $\_GET[“var1”];” in the php it stops working.

Any help would be much appreciated.

Have a great day all!

AS:

var send\_lv:LoadVars = new LoadVars();

myBtn\_mc.onRelease = function()  
{  
$var1 = myText\_txt.text  
send\_lv.sendAndLoad(“myphp.php?var1=”+$var1, send\_lv, “POST”)  
function loadMyXml(success:Boolean)  
{  
if (success)  
{  
display\_txt.text = this.firstChild.childNodes  
}  
}  
var myXml = new XML();  
myXml .ignoreWhite = true;  
myXml .onLoad = loadMyXml;  
myXml .load(“myphp.php”);

}

PHP:

\<?PHP

$user = $\_GET[“var1”];

echo "\<?xml version=“1.0”?\>  
";  
echo "\<users\>  
";  
echo “\<user\>” . $user . "\</user\>  
";  
echo "\</users\>  
";

?\>
