mime.b64 encodes your username and password so they are not sent in clear text across the internet. You have to in your PHP script un-encode them.
In your php script, do something like this;
$login = base64\_decode($\_GET["login"]);
$senha = base64\_decode($\_GET["senha"]);
If you don’t care about encoding the login and password, just skip the mime.b64 stuff completely.
In your call back, you get an event structure/table called “event” (based on your setup above) and that table has a member called response (event.response). The contents of that is the entire data returned from the PHP script. So if your script outputs “It’s a beautiful day in the neighborhood”, you should expect your app to print on the console:
It’s a beautiful day in the neighborhood
when you do a print(event.response).
Building this system is two part, first making sure your app works and is communicating with the server and secondly making sure the server side is doing what is expected.
I don’t know what you want your PHP script to tell your mobile app when an account is successfully registered or when it successfully logs in. In my case, I have the PHP script print some JSON structure out:
<?php <br> $results = array();
$results["sessionID"] = sessionID;
$results["message"] = "Success";
echo json\_encode($results);
?\>
I don’t print any additional information, like HTML tags and I get that JSON structure as the contents of my event.response, which I can pass to json.decode to get a Lua table to use.
But you are your own programmer and what your login/register.php spits out is up to you. though I would think that if you’re getting a bunch of HTML somethign else is going on. Your results is getting a blank HTML document that is executing a script to say “Success” and then redirecting you to some other page. Which is what you get if you actually run that page on your own directly in the browser.
So you are successfully capturing what the server is sending. You just are not getting what you want. [import]uid: 19626 topic_id: 16358 reply_id: 62421[/import]