Generally speaking, you’re going to have to setup a database on your host, most likely MySQL to have the necessary tables to track the data you want to save and retrieve. Next you will need to write some server side code in a language like PHP or Python that can communicate with the database and yet still output data to web requests. The scripts that do this would have a URL like:
http://yourhost.com/yourapp/getscore.php
If you created a script called getscore.php that talked to the database. In Corona SDK you then use the network.request() API to get the data, something like:
network.request(“http://yourhost.com/yourapp/getscore.php”, “GET”, callbackListener)
Where callbackListener is a function that handles getting the results of the call back into your app. You would be responsible for managing any security needs for your server and database. Your scripts would need to be hack proof (no SQL injections, no clearly visible passwords, one way encrypted password hashes on the server side.
If you’ve never done this before and don’t have experience with network programming, Corona SDK offers several plugins for doing this, like PlayTogether as well as using Google Play Game Services or Apple’s GameCenter to track leaderboards for high scores. Several people in the community have been putting together an easy to use Parse.com setup if you want more database flexibility. You would need to search the forums for parse to find those threads.
Rob