How do I get variables back from PHP?

0 favourites
  • 2 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • Hello! I am new to Construct 2 and far more used to languages and IDE's like Unity3D (Which helped boost my C# knowledge) and Flash AS3, however - Construct 2 harkens back to how I got my start programming with application builders like Multimedia Fusion. So far, I've set up a basic configuration with login/etc screen and all. However.. I can hit "Login" and get back strings, but text refuses to display any output variables with AJAX.LastData, which is rather strange.

    For instance, the string output like this:

    echo "{'User': '" . $UserName . "', 'Email':'John@Doe.com'}";

    This how it gets back into Construct 2: {'User': '', 'Email':'John@Doe.com'}.

    So... AJAX.LastData is working, but it only sees solid strings, not variables which I know are being -sent-. One is a "task" var that will change what happens, standard. What am I doing wrong?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • And now I feel stupid. Little more testing... putting the variable definition into the function being called by Task suddenly gets results.

    Okay, so that one was entirely my fault - I've been working with frameworks for far too long and not with raw PHP enough.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)