Hi everyone.
Tom asked me to post the highscore-script for everyone.
What you need:- Webserver with PHP and MySQL installed.
- Some basic knowledge on how to use the webserver.
What you get:- Post a user score to the database and get the current place of this score.
- Ask the database for the top N scores.
What you need to consider:The script is by no means secure. Please use it via a https connection if possible. Even then, somebody with access to the apps source might be able to spoof scores.
What you need to do:Download the attachment and edit the db_connect.php
- Change the $highscorename to a value of your choosing. The Value needs to be unique (e.g. if you want multiple score for multiple apps use "highscore1", "highscore2", and so on).
- Change the $key to a reasonable complex value. Best to use a password generator.
- Enter your databases access details into the $sql_xxx values. You should get these from your server-provider
- save and close
- upload everything to your webserver (e.g. via FTP)
- [The crossdomain.xml is only needed if you are planning on releasing a flash version of your app. Delete it otherwise]
- Call the install.php in your webbrowser (e.g.
www.mydomain.com/placewhereiputthethings/install.php)
- you should see a message telling you everything is fine. If not, probably your PHP or MySQL version is out of date.
- delete the install.php from you server.
- Have fun with your highscore. You should now be able to use it like Tom described above.
Detailed usage:call highscore.php to get the top 10 scores in the format:
Place,Name,Score
Place,Name,Score
and so on.
you can override the "10" by providing the variable count. E.g.: highscore.php?count=20
call submit.php to enter a new score. The following variables must be set:
key: your choosen key
name: name of the scorer
score: actual score
E.g.: submit.php?key=ABCD1234&name=Terminator&score=9001
You will get the current placement as return:
Place,Terminator,9001
I have no webserver
! What should I do?If interest is there, we could provide a server for the community. The server would need to be paid of course...
enjoy,
The Rauschgift
P.S.: Suggestions and error reports always welcome, but will be considered on a random schedule
