i have a game that i made www.thenewedinburg.com/obstacles.html at the end i would like to ask the user to input his name and that name to be saved in a .txt file that is stored in the webpage like for example www.thenewedinburg.com/savename.txt so that any user that plays and gets a high score can save their name. just like a leaderboard.
the applet runs fine i just need to add the leaderboard which i dont know how to do it. what i have is this so far but it doesnt work for web.
import java.io.FileWriter;
import java.io.PrintWriter;
public class write {
public void SaveCharacters(String Character){
try{
FileWriter outFile= new FileWriter("write.txt");
PrintWriter out=new PrintWriter(outFile);
out.println(Character);
out.close();}
catch(Exception e){
}
}
}
thanks in advance. any suggestions or comments to help me work it out will be appreciated.