In Flash, I’m trying to pass some flash vars to a .php script that’s running an SQL query.
The .php echoes xml that I’m parsing in flash.
Here’s my problem:
var postMe:String = "I want to get posted to php so it can use me in the SQL query";
var sqlQuery = new XML();
sqlQuery.ignoreWhite = true;
sqlQuery.onLoad = loadSQL;
sqlQuery.load("http://www.mySite.com/my.php");
function loadSQL(){
}
As is, in my .php I can’t use:
$var = $_POST[“postMe”];
How do I get the postMe var into the .php and still use the XML.onLoad to grab the data returned from .php?
or
How do I get my cake and eat it too?
var postMe:String = “I want to get posted to php so it can use me in the SQL query”;
var sqlQuery = new LoadVars();
var sqlReceiver = new XML();
sqlReceiver.ignoreWhite = true;
sqlReceiver.onLoad = loadSQL;
sqlQuery.postMe = postMe;
sqlQuery.sendAndLoad(“http://www.mySite.com/my.php”, sqlReceiver, “POST”);
function loadSQL(){
}
[quote=nburlington;2327532]In Flash, I’m trying to pass some flash vars to a .php script that’s running an SQL query.
The .php echoes xml that I’m parsing in flash.
Here’s my problem:
var postMe:String = "I want to get posted to php so it can use me in the SQL query";
var sqlQuery = new XML();
sqlQuery.ignoreWhite = true;
sqlQuery.onLoad = loadSQL;
sqlQuery.load("http://www.mySite.com/my.php");
function loadSQL(){
}
As is, in my .php I can’t use:
$var = $_POST[“postMe”];
How do I get the postMe var into the .php and still use the XML.onLoad to grab the data returned from .php?
or
How do I get my cake and eat it too?[/quote]
What toltec7 isdoing is taking the XML object that you created, creating a new property for it and assigning the value of postMe to it.