I'm trying to get a code in which users enter in their username and it creates a html file for them. I'm having a hard time getting the code to work and would appreciate some help. Also, if I were to upload this code, would it work or do I have to do something serversided?
<.html>
<.head>
<.title><./title>
<./head>
<.body>
<.script>
function WriteToFile(var userName) {
//set fso = CreateObject("Scripting.FileSystemObject");
//var userName = document.getElementById('user_name').value;
File file = new File(userName + ".html");
//set newFile = fso.CreateTextFile(userName + ".html");
//BufferedWriter output = new BufferedWriter(new FileWriter(file));
//output.write("test");
//output.close();
}
<./script>
<.form action="">
<.p>
User name: <.input type="text" id="user_name">
<.input type="submit" value="Create new page" onclick="return WriteToFile(user_name);">
<./p>
<./form>
<./body>
<./html>