<%@ LANGUAGE="VBScript" %> <%Option Explicit%> <% Dim con, rs, strSql If Request.Form("cmdSubmit") <> "" Then 'The user has submitted the page, so process the Newsletter unsubscribe request 'Connect to the database Set con = GetDBConnection() 'Verify that the email address exists in the database strSql = "SELECT Email FROM Subscribers WHERE Email = '" + Request.Form("txtEmail") + "'" Set rs = Server.CreateObject("ADODB.Recordset") rs.Open strSql, con, 1, 2 If Not(rs.EOF) Then 'The email address does not already exist, so add it rs.Delete() rs.Update() 'MODIFY the text below is displayed when an email is removed from the newsletter %> You have been removed from the newsletter. <% Else 'MODIFY the text below is displayed when a person enters an email address that is not ' receiving the newsletter %> Your email address was not found in our system. <% End If 'Clean up database objects rs.Close() Set rs = Nothing con.Close() Set con = Nothing Else 'MODIFY the text below is displayed when the page is first loaded. %>
Enter your email address to unsubscribe:

<% End If %>