Connecting to a server

Hello

Are there anyway I can connect to a webserver to retrieve data about users etc.? (User login)

Any tips on how I would go about this? [import]uid: 95786 topic_id: 23900 reply_id: 323900[/import]

Corona SDK provides to mechanisms for this.

One is to use Lua Sockets and HTTP support. This is the way to go if you must wait on the server response.

However if you can let the server response happen in the background and then fire off some action, then you can use the network.request() API call.

I personally prefer the latter because it’s pretty straight forward to use.

You basically have a URL that your going to do a HTTP GET request on, like:

http://www.mysite.com/login.php?username=fred&password=barney

Of course you would want to mime.base64 encode the password and probably even the username or use https://

Then your login.php takes that information and then outputs something indicating success or failure.

When the webserver responses, a function that you write is called with the data from the server and then that function can trigger other behavior in your app. [import]uid: 19626 topic_id: 23900 reply_id: 96302[/import]