Hi
I try to get back some data from php after login for example I use most common example of communication. This is part of my function
function Login() {
var form = new WWWForm(); //creating a new form connection
form.AddField( "myform_hash", hash ); /
form.AddField( "login", formNick );
form.AddField( "password", formPassword );
var w = WWW(URL, form); //here we create a var called 'w' and we sync with our URL and the form
yield w; //we wait for the form to check the PHP file, so our game dont just hang
if (w.error != null) {
print(w.error); //if there is an error, tell us
} else {
print("Test ok");
print(w.data);
formText = w.data; //here we return the data our PHP told us
}
So in response I get string containing all data showed by echo function in php script. It is very complicated to retrieve variables form that string. So Is there an easier way to send back variables form PHP to Unity JS ?