I am new to talking to PHP.
Trying to test sending data to a .php page both on a localhost server and on a remote server
I am trying following code:
echo "hello world 808080";
When sending to the localhost server I am getting an HTTPStatus of 200 back - suggesting something is working.
If I set loader.dataFormat = URLLoaderDataFormat.TEXT; to URLLoaderDataFormat.VARIABLES
I get an error:
Error: Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.
which suggests that when I use URLLoaderDataFormat.TEXT; that the data is being sent.
However I can't get the .php page to update.
Any help greatly appreciated.
Best Tommy Banana
So we have tested the .PHP page and it works fine receiving a GET message from html.
eg clicking on the link
gets the variables displayed on the php page in the GET section using the php code above.
So the problem is in getting the .swf file to talk to the .php correctly.
So in case anyone else ends up here. This code worked:
So now I have the POST method working from AS3 to PHP and getting data back I can now try and work out how
to build the thing I need.... using JSON!
NB For it to work I needed to have both the .php and .swf file in the same directory online and not to use an absolute URL.
I tell a lie - it does work with an absolute URL!