Copy link to clipboard
Copied
I know this is really old tech but I am still using it!1
So I have a test .php page set up by my mySQL guy on let's call it http://ourserver/local/rest/index.php and I need to POST 'abc_request' to it, with and send a key - {"key":"1234567"}.
I have the following code:
AS3:
var phpVars:URLVariables = new URLVariables();
var phpFileRequest:URLRequest = new URLRequest("http://ourserver/local/rest/index.php");
phpFileRequest.method = URLRequestMethod.POST;
phpFileRequest.data = phpVars;
var phpLoader:URLLoader = new URLLoader();
phpLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
phpLoader.addEventListener(Event.COMPLETE, showResult);
// I a, trying the following ....
phpVars.abc_request;
phpVars.username = 'abc_request';
phpVars.password = 'abc_request';
phpVars.key = "1234567";
phpLoader.load(phpFileRequest);
the relevant PHP code is:
Copy link to clipboard
Copied
So - I tried putting the .swf online rather than testing from within anuimate so it doesnt seem to be throwing the IO error now....
So now to get it to push 'abc_request'