str3ber
04-25-2006, 02:39 PM
Hi!
I am going nuts! I hate the god damn special character crap! It is 2006, this should not be a problem!!!
Well, I am developing a flash app that will be used on PDA:s. I have a functional version that's using xmlSockets. The problem is that it won't work on the PDA:s... So now I am converting the app to use LoadVars And php instead. I first tried to use the xml.sendAndLoad but then I realized that the flash xml parser converts " to " and that php do not understand this and convert it back. So then I tried to use loadVars, and I be damned! This crap converts the " to \" instead! Why!? This is so strange, it has ruined my day and I have lost all the hope for humanity (almost).
What I am trying to do is to send a string from flash that will contain a sql query, like: SELECT * FROM itool_user WHERE USERNAME="Bill"
In flash it is a simple loadVars thingy:
function SendCommand(Command:String, mcCalledBy:MovieClip):Void {
var lvReply:LoadVars = new LoadVars();
lvReply.onLoad = function() {
trace(lvReply.reply);
}
var lvCommand:LoadVars = new LoadVars();
lvCommand.com = Command;
lvCommand.sendAndLoad(sServer, lvReply, "POST");
}
An in php, this:
<?
$command = $_POST["com"];
echo("&reply=".$command);
?>
Ok, so the lvReply.reply traces SELECT * FROM itool_user WHERE USERNAME=\"Bill\" and if I try to query that to the DB it returns an error (of course). Why is php adding the \ to the " ???
I thought that my idea to send the complete query string was good since I will have most of the work done in flash, but it seems impossible to do! Why can't I send a simple simple simple string to php?
I am going nuts! I hate the god damn special character crap! It is 2006, this should not be a problem!!!
Well, I am developing a flash app that will be used on PDA:s. I have a functional version that's using xmlSockets. The problem is that it won't work on the PDA:s... So now I am converting the app to use LoadVars And php instead. I first tried to use the xml.sendAndLoad but then I realized that the flash xml parser converts " to " and that php do not understand this and convert it back. So then I tried to use loadVars, and I be damned! This crap converts the " to \" instead! Why!? This is so strange, it has ruined my day and I have lost all the hope for humanity (almost).
What I am trying to do is to send a string from flash that will contain a sql query, like: SELECT * FROM itool_user WHERE USERNAME="Bill"
In flash it is a simple loadVars thingy:
function SendCommand(Command:String, mcCalledBy:MovieClip):Void {
var lvReply:LoadVars = new LoadVars();
lvReply.onLoad = function() {
trace(lvReply.reply);
}
var lvCommand:LoadVars = new LoadVars();
lvCommand.com = Command;
lvCommand.sendAndLoad(sServer, lvReply, "POST");
}
An in php, this:
<?
$command = $_POST["com"];
echo("&reply=".$command);
?>
Ok, so the lvReply.reply traces SELECT * FROM itool_user WHERE USERNAME=\"Bill\" and if I try to query that to the DB it returns an error (of course). Why is php adding the \ to the " ???
I thought that my idea to send the complete query string was good since I will have most of the work done in flash, but it seems impossible to do! Why can't I send a simple simple simple string to php?