Save input to file

I can not find how to save name & email entered to logfile.dat with the following code. Can anyone help me? Thank you.

<html>
<HEAD>

<SCRIPT language=“JavaScript”>

function WriteFile(name, email)
{
var fso = new ActiveXObject(“Scripting.FileSystemObject”);
var fh = fso.CreateTextFile(“D:\logfile.dat”, true);
fh.WriteLine(name);
fh.WriteLine(email);
fh.Close();
}

function sendtopage(whatpage)
{
alert(whatpage)
window.location.href =whatpage;
return true;
}

redirectTime = “3000”;
redirectURL = “http://www.cnn.com”;
function timedRedirect() {
alert(‘Thank you’);
setTimeout(“location.href = redirectURL;”,redirectTime);
}

function getCookie(c_name)
{
var i,x,y,ARRcookies=document.cookie.split(";");
for (i=0;i<ARRcookies.length;i++)
{
x=ARRcookies*.substr(0,ARRcookies*.indexOf("="));
y=ARRcookies*.substr(ARRcookies*.indexOf("=")+1);
x=x.replace(/^\s+|\s+$/g,"");
if (x==c_name)
{
return unescape(y);
}
}
}

function setCookie(c_name,value,exdays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value=escape(value) + ((exdays==null) ? “” : “; expires=”+exdate.toUTCString());
document.cookie=c_name + “=” + c_value;
}

function checkEmailCookie()
{
var email=getCookie(“email”);
if (email!=null && email!="")
{
alert("Email: " + email);
}
}

function checkNameCookie()
{
var name=getCookie(“name”);
if (name!=null && name!="")
{
alert("Name: " + name);
}
}

</SCRIPT>
<style type=“text/css”>
.Class01 {
font-family: “Lucida Sans Unicode”, “Lucida Grande”, sans-serif;
font-size: 24px;
font-weight: bold;
}
.Class02 {
font-size: 36px;
font-family: “Lucida Sans Unicode”, “Lucida Grande”, sans-serif;
}
.Class013 {
font-family: “Lucida Sans Unicode”, “Lucida Grande”, sans-serif;
}
.Class01 .Class013 .Class01 {
font-weight: bold;
}
.Classzz {
font-family: “Lucida Console”, Monaco, monospace;
}
.Classxx {
font-weight: bold;
font-size: 24px;
}
.Classzz {
font-family: “Lucida Console”, Monaco, monospace;
}
.style1 { text-align: center;
}
</style>
</HEAD>

<body gcolor="#FFFFFF" background="…/MCM-background.jpg">

<center>
<p class=“style1”><img src="…/mcm_header2.gif" alt=“Header” width=“790” height=“199”></p>
</center>
<p></p>
<form name=“fm” action=“testscript”>
<div align=“center”>
<p> </p>
<p><span class=“Class01”><span class=“Class02”>Please enter the following.</span></span></p>
<p> </p>
<p><span class=“Class01”>Your Name:    </span>
<input name=“name” type=“text” size=“60” />
</p>
<p><span class=“Classzz”><br />
<span class=“Classxx”>Your eMail:</span></span><span class=“Class01”>   </span>
<input name=“email” type=“text” size=“60” />
<script type=“text/javascript”>
setCookie(“email”,document.fm.email.value,365);
setCookie(“name”,document.fm.name.name.name.name.value,365);
</SCRIPT>
</p>
<p>
<input name="" type=“submit” class=“Class01” OnClick=“alert(‘Thank You !’);” value=“Submit”/>
</p>
</div>
</form>

</body>
</html>