Sounds like you want to use server side script then. Lets say you have an asp page that receives this url:
Code:
www.games.co.uk/myScores.asp?name=joe&score=100
.
In the asp page you have code (you said to use JavaScript):
Code:
var sName = Request("name") + "";
var iScore = parseInt(Request("score") + "", 10);
Now you also have a text file, stored in the same folder as the asp page. This file is name after the user, <username>.txt, and has their previous score
Code:
var ForReading = 1;
var ForWriting = 2;
var sFileName = Server.MapPath(sName + ".txt");
var oFso = new ActiveXObject("Scripting.FileSystemObject");
if (oFso.fileExists(sFileName))
{
var oTS = oFso.OpenTextFile(sFileName, ForReading);
var iLastScore = oTS.readLine();
oTS.close();
iLastScore = parseInt(iLastScore, 10);
if (iLastScore < iScore)
{
oTS = oFso.OpenTextFile(sFileName, ForWriting);
oTS.writeLine(iScore);
oTS.close();
}
}
else
{
//Something wrong?
}
You can look at more on FileSystemObject on msdn.com. For example if the file does not exist because it's their first game you can create it from scratch.
--
Joe