I once did this for Alexland. Since I didn't really want to dwell into how to send proper HTTP requests and send data via POST, I used some unit for simple web fetching and passed all the data through GET. So it was kind like

Unit.ConnectToSite('http://mysite.com');
Unit.GetDocument('http://mysite.com/scores/mygame/script.php?data1=value1&data2=value2');

I had three scripts on the server side:
info.php - this one returned the modification date of the high-scores - no need to download them if nothing changed, eh?
get.php - as can be guessed, this one returned the high-score table
submit.php - used to send the scores

Whereas what info.php and get.php should return is obvious, my submit.php returned one of the following:
<a number> - means the score you submitted made it into the table and holds the <number> place
sorry - the score did not make it to the table
error - the score is lacking data or somehow else damaged
gtfo - the score has already been submitted or it's checksum is wrong - you're probably cheating
version - wrong game version

'error' and 'version' could also be returned by info.php and get.php, to signalize errors.

If you want, I could send You the script I used, of course after modyfing it a bit (so I won't give out much of the game ) and adding some comments.