can you help me how to submit form and store the values in a .csv file and post it in another html.

here is my code...
<html>
<head>
<title>myForm</title>
<script language="JavaScript">

function WriteToFile(sText) {
first=document.myform.GivenName.value;
initial=document.myform.MiddleInitial.value;
last=document.myform.Surname.value;
f = document.getElementById("Course");
course = f.options[f.selectedIndex].text;
g = document.getElementById("year");
year = g.options[g.selectedIndex].text;
txtArea=document.myform.comments.value;
for (var i=0; i < document.myform.gender.length; i++){
if (document.myform.gender[i].checked){
var rad_val = document.myform.gender[i].value;
}
}

var fso = new ActiveXObject("Scripting.FileSystemObject");
var d = fso.OpenTextFile("d:\\guest.csv", 8, true, 0);
d.Write(first+",");
d.Write(initial+",");
d.Write(last+",");
d.Write(rad_val+",");
d.Write(course+",");
d.Write(year+",");
d.Write("COMMENTS:"+",");
d.WriteLine(txtArea);
}
</script>
</head>
<body bgcolor="#000000" text="#FFFFFF">
<form name="myform" onSubmit="WriteToFile(this)">
Given Name:<input type ="text"name ="GivenName"value=""/><br>
Middle Initial:<input type ="text"name ="MiddleInitial"value=""/><br>
Surname:<input type ="text"name ="Surname"value=""/><br>
Gender:<br>
<input type="radio" name="gender"value = "male">Male
<input type="radio" name="gender"value = "female" >Female


<P>Course: <SELECT id="Course" SIZE="1">
<OPTION value="1" selected="selected">-
<OPTION value="2">Bachelor of Science in Information Technology (B.S.I.T)
<OPTION value="3">Bachelor of Science in Computer Sciences (B.S.C.S)
<OPTION value="4">Bachelor of Science in Information Management (B.S.I.M)
<OPTION value="5">Bachelor of Scinece in Nursing(B.S.N)
<OPTION value="6">Bachelor of Scinece in Elecetrical Engineering(B.S.E.C.E)

</SELECT>
<P>YEAR: <SELECT id="year" SIZE="1">
<OPTION value="1" selected="selected">-
<OPTION value="2">1
<OPTION value="3">2
<OPTION value="4">3
<OPTION value="5">4
<OPTION value="6">5

</SELECT>
<br>Comments:<br>
<textarea name="comments" rows="10" cols="120" value=""></textarea>
<br>
<br>
<input type="submit" value="submit" />

<input type="reset" value="clear" onClick="clear()" />
</form>
</body>
</html>