-
PHP reading in flash
Ok, I get confused over this simple question all the time.
so I want to send variables to a PHP document to process and all.
in the PHP document it gets the variables I used with $_REQUEST
anyways how do I send the variables to the PHP document? SEVERAL WAYS.
here's one way:
load = new LoadVars();
load.stuff = 1;
load.sendAndLoad("stuff.php",load,"GET");
or
load.sendAndLoad("stuff.php",load,"POST");
I make it send and then load again so that I get a response.
i can also use this way:
load.load("stuff.php")
does it work the same?
also I see this alot and it has worked before for me in flash CS3 (AS 2.0):
loadVariables("load.php")
yeah sometimes I get confused on which one is most secure and which i should use to send variables.
so which out of the 4 should I use?
-
It really depends on what you need to do. sendAndLoad & just load obviously serve different purposes. sendAndLoad involves sending variables as well as loading the response. load just... loads the document. There's also just a send method to send the variables and ignore the response.
You should avoid the old-school loadVariables. You don't have the control like you do with LoadVars.
And POST is much more secure than GET. Still not "secure" by any means, but it's the best out of the basic HTTP protocol.
-
Ok, thanks man. I'll stick to SendAndLoad because I would like a response. and Ok, I will use POST which I always heard was better.
thanks one again, you are an exact example of all the kind flashkit members willing to help everybody out with their time.