The steps are:
1. Make a connection to the domain:
http = CreateHTTPConnection()
// check for error: http<1
ret = SetHTTPHost(http,"www.domain.com",0)
// make sure good: ret > 0
2. Build your argument string (not the file name, just things like playerid=123 and thescore=5000). Eg. "playerid=123&thescore=5000
Make sure to replace any spaces or characters other than a-z,0-9 with the hex equivalent. A space would be '%20', if you needed the ampersand as part of the argument value, it would be '%26', a forward slash '/' would be '%2F'.
3. Send the page request (I prefer asynchronous because you can do things to show that the process is not hung):
async = SendHTTPRequestAsync(http,"scripts/script.php",argstring)
timeoutat = Timer() + 60.0
4. Wait for the results:
while (GetHTTPResponseReady(http) = 0) and (Timer() < timeoutat)
// show something
endwhile
5. Check results
if Timer > timeoutat
// timeout occurred, do something
else
// get the results
thereturn = GetHTTPResponse(http)
// process the string
endif
In my scripts, I return lots of information by putting together a string with a delimiter ('|'). If I need subinformation, then I use a second one ('~') in the groups between the '|'s.
The same script that accepts the input on your server can check to see if the uploaded score is in the top ten. Get the minimum score stored ("SELECT scoreid,MIN(score) FROM score_table"). If the uploaded score is not greater than it, ignore it. If it is, then update it.
It is a good idea to have an unique id value stored with the scores so that you can simply replace the value ("UPDATE score_table SET score=newscore WHERE scoreid=oldid").
Do you know how to get the values passed up in a script? ($aval = $_REQUEST['varnam']
. This assumes a relatively current version of PHP on your server.
Are you familiar with MySQL (and relational databases in general)?
Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master