<% Const adOpenKeyset = 1 Const adLockOptimistic = 3 Dim strEmail strEmail = Request("Email") Dim strCustName If strEmail <> "" And Request("Remove") <> "Now" Then ' RS to check if email exists. DIM mySQL, objRS Set objRS = Server.CreateObject("ADODB.Recordset") mySQL = "SELECT * FROM Customers Where Email = '"& strEmail &"'" objRS.Open mySQL, objConn, 1, 3 If objRS.EOF Then Response.Redirect "error.asp?Error=" & strEmail & " is not in our database." Response.End End If strCustName = objRS("FName") Elseif Request("Remove") = "Now" Then strCustName = Request("Name") objConn.Execute"Update Customers Set Active = 'No' Where Email = '"& strEmail &"'" Else Response.Redirect "error.asp?Error=An error has occurred. Your email is still active.

" &_ "If this problem continues please email us from the contact page and we will remove you promptly." End If %> Remove from Email List text="#<%= strText %>" link="#<%= strLink %>" vlink="#<%= strVLink %>" alink="#<%= strALink %>">

<% If Request("Remove") = "Now" Then %> <%= strEmail %> has been removed from our mailing list.

Return to Home

<% Else %>

Are you sure you want to leave our email list?

Name:

<%= strCustName %>

Email:

<%= strEmail %>
 
<% End If %>