We are trying to develop code that writes to a text file using request.query string(donor) to bring in a member number and using two radio buttons that have values of Yes or No. So our end results in the text file should be: 123456789, N
We have code that is writing the member number(donor) to the text file before the submit button is clicked. We only want it to write to the text file once the submit button is clicked. Also, it is not reading the value of the radio buttons. We think we need to call a function from the submit button, but not sure how to do it. Here is the code:
<%@LANGUAGE=”VBSCRIPT” CODEPAGE=”1252″%>
<%
strdonor = request.QueryString(“donor”)
Dim objFSO
Dim TSO
MyFile = Server.MapPath(“/emlnotic.txt”)
Set objFSO = Server.CreateObject(“Scripting.FileSystemObject”)
Set TSO = objFSO.OpenTextFile(MyFile,8)
TSO.Write strdonor & vbcrlf
TSO.close
Set TSO=nothing
Set objFSO=nothing
%>
<html >
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title>Untitled Document</title>
</head>
<body>
<table width=”46%” border=”0″ align=”center”>
<tr>
<td> </td>
</tr>
<tr>
<td><font size=”2″ face=”Verdana”>By selecting this link you are requesting to stop receiving emails from the Association.</font></td>
</tr>
<tr>
<td><div align=”center”><b>Member #</b><%=Request.QueryString(“donor”)%></div></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><font face=”Verdana”><font size=”2″>Would you like to continue receiving emails from us?</font></font></td>
</tr>
<tr>
<td>
<form action=”updatednew.asp” method=”post”>
<p>
<input name=”Subscribed” type=”radio” value=”y” checked /> Yes, continue to send me emails. </p>
<p>
<input name=”Subscribed” type=”radio” value=”n” /> No, remove me from your email list. </p>
<p>
<input name=”Submit” type=”submit” value=”Submit” />
</p>
</form>
</td>
</tr>
</table>
</body>
</html>