Online High Score Table

Blitz3D Forums/Blitz3D Beginners Area/Online High Score Table

You could use GET to send the users score as a part of the URL, eg:
GET www.alloidgames.com/raingamehs.php?user=joe&score=12345"

But useing GET allows the user to edit this and send it manually over the Adresslin ef a browser.

You can use POST instead of GET (see code archives), but basicly the best protection against cheating is to encrypt the data and/or add some kind of checksum, so invalid data will be rejected. If you do this, you may use GET without any risk.

I would strongly suggest to use a php script that will read the users score and name, compare it to the list and add his score to the list if required, then return the updated list to the user in text format. This is really very simple when you know the basics of PHP and MySql, assuming your server supports PHP and MySql. You may use a simple textfile instead of the Database MySql to store the list, but MySql offers very simple sorting functions, so all you have to do is reading the database sorted by the size of the score field.

However, using a checksum to validate the score must be done in a way that is not known by the public. Example:

a=12345 ; the score!

b$=a
checksum=0
for i=1 to len(b$)
checksum=(checksum+floor(mid$(b$,i,1))*1234) and $FFFF
next

c$=user$+"."+b$+"."+checksum

c$ will then be sent to the server, as GET parameter.

now the php script will extract username, the score and the checksum. It will then create its own checksum from the received score (using the same code, but in php). If the received checksum and the instantly created checksum are the same, the score is valid and legal. If they differ, it's a cheater and you may send a string like "you lousy cheater! your harddrive will be formated in 3 seconds, byebye!"