Take the 2-minute tour ×

I am new to web game development and I am trying to do a web canvas game for a competition.

I have finished most of the codes but I am having problems with the highscore system which is a requirement for the game.

I have access to the server where I can host my game but it does not support SQL.
I am thinking of using only XML and ajax to manage the highscore.

Is this possible? Is that any reference that I can look into?

So far I haven't find a way to modify XML files with ajax directly.

I am aware that php is able to modify XML files, but I am also not sure whether the server will be able to support that.

Do all php servers support handling of XML files the same way?

(I know there is a difference between php 4 and php 5)

Any detailed tutorial on how to modify XML files in JavaScript will be appreciated.


Also, the organizer has provided this document which is supposed to help with the highscore system:

1 Create a text or XML file to store top 10 scores

To be able to store your game high-scores online you will need an Web-server and an online database. Hence, create a empty text file that will act like a database.

Determine what will be the delimiter to identify/separate each score. (Delimiter can be a “,” or line break, etc)

2 Recording of High Scores

To be able to establish this highscore list in your text file, you first have to collect the score of player once player had completed his game.

With the collected score, your system will need to access the text file’s content.

If the score collected is higher than the 10 scores in the text file, write the collected score inside the text file. Otherwise, discard the collected score.

If collect score had been written inside the text file, the game will re-arrange the standings of all the top 10 scores. And the last score which is previously recorded in the text file will be removed.

Tips to note

To avoid hacking, input parameters should be handled properly

You may wish to add some verification into the send scores, so someone cannot easily manipulate the scores by manually sending one.

share|improve this question
are you sure it doesn't support SQL or SQLite? phpinfo() will provide you information about extensions installed. –  Phoenix Jun 21 '12 at 13:27
Its well documented; you can use the PHP DOM functions: nl.php.net/manual/en/book.dom.php –  Oritm Jun 21 '12 at 13:42
where is the score calculated? On the client side or the server side? If it's on the client side, people will cheat by submitting high numbers to the script recording the scores. Also, it is not very clear what you are looking for since you ask for PHP and JavaScript. –  Gordon Jun 21 '12 at 13:43
@GeoPhoenix Well, I think it does not even support PHP...iras20thdev.blob.core.windows.net/games/ACJC/htdocs-Copy21063/… –  paradite Jun 21 '12 at 13:44
@Gordon,the whole game is on the server, so cheating shouldn't be a problem. Now I would prefer a pure JavaScript solution since the server does not seem to support PHP. –  paradite Jun 21 '12 at 13:46

Your Answer



Browse other questions tagged or ask your own question.