redirect.asp ser sådan ud:
<%@ LANGUAGE = "VBScript" ENABLESESSIONSTATE = False %>
<%Option Explicit%>
<%Response.Buffer = True%>
<!--#include file="conn.asp"-->
<%
Dim email, subscribe, unsubscribe, action
email = Request.Form("email")
if Request.Form("action") = "subscribe" then subscribe = True else subscribe = False end if
if Request.Form("action") = "unsubscribe" then unsubscribe = True else unsubscribe = False end if
%>
<HTML>
<HEAD>
<META NAME="Generator" CONTENT="Stone's WebWriter 3.5">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<TITLE><%=sitename%> Error</TITLE>
</HEAD>
<BODY bgColor="#FFFFFF" text="#000000">
<DIV align="center">
<CENTER>
<TABLE border="0" cellpadding="0" cellspacing="0" width="600" bgcolor="#31619C">
<TR>
<TD width="50%"><FONT size="1"> </FONT><FONT face="Verdana, Arial" size="4" color="#FFFFF8"><STRONG><EM><BR>
Error...</EM></STRONG></FONT></TD>
<TD width="50%" valign="top" align="right"><STRONG><FONT face="Verdana, Arial" size="1" color="#FFFFF8"><%=listname%> fra<BR></FONT><a href="<%=url%>" target="_blank"><font face="Verdana, Arial" size="1" color="#FFFFFF"><%=sitename%></font></a><FONT face="Verdana, Arial" size="1" color="#FFFFF8"> </FONT> </STRONG></TD>
</TR>
</TABLE>
</CENTER>
</DIV>
<DIV align="center">
<CENTER>
<TABLE border="0" cellpadding="0" cellspacing="0" width="600" bgcolor="#000000" height="2">
<TR>
<TD><IMG src="spacer.gif" width="1" height="1"></TD>
</TR>
</TABLE>
</CENTER>
</DIV>
<DIV align="center">
<CENTER>
<TABLE border="0" cellpadding="0" cellspacing="0" width="600">
<TR>
<TD bgcolor="#000000" width="1"><IMG src="spacer.gif" width="1" height="1"></TD>
<TD width="599">
<DIV align="center">
<CENTER>
<TABLE border="0" cellpadding="0" cellspacing="0" width="100%">
<TR>
<TD width="50%" align="left"><FONT face="Verdana, Arial" size="1"><STRONG> </STRONG></FONT></TD>
<TD width="50%" align="right"><FONT face="Verdana, Arial" size="1"><%= Now() %></FONT></TD>
</TR>
</TABLE>
</CENTER>
</DIV>
<DIV align="center">
<CENTER>
<TABLE border="0" cellpadding="0" cellspacing="0" width="100%">
<TR>
<TD width="100%" align="center">
<DIV align="center">
<CENTER>
<TABLE border="0" cellpadding="0" cellspacing="0" width="100%">
<TR>
<TD width="100%">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" valign="middle" align="center">
<%
If subscribe = "True" then
rsSubscribe()
End If
If unsubscribe = "True" then
rsUnsubscribe()
End If
%>
</td>
</tr>
</table>
</TD>
</TR>
</TABLE>
</CENTER>
</DIV>
</TD>
</TR>
</TABLE>
</CENTER>
</DIV>
<DIV align="center">
<CENTER>
<TABLE border="0" cellpadding="0" cellspacing="0" width="100%">
<TR>
<TD width="100%" align="center"></TD>
</TR>
</TABLE>
</CENTER>
</DIV>
</TD>
</TR>
</TABLE>
</CENTER>
</DIV>
<DIV align="center">
<CENTER>
<TABLE border="0" cellpadding="0" cellspacing="0" width="600">
<TR>
<TD bgcolor="#000000" height="2"><IMG src="spacer.gif" width="1" height="1"></TD>
</TR>
</TABLE>
</CENTER>
</DIV>
<DIV align="center">
<CENTER>
<TABLE border="0" cellpadding="0" cellspacing="0" width="600">
<TR>
<TD align="right" width="50%"><font face="Verdana, Arial" size="1" color="#C0C0C0">Powered
by </font><a href="
http://www.doitasp.com"><font face="Verdana, Arial" size="1" color="#C0C0C0">ListMail
2.0</font></a></TD>
</TR>
</TABLE>
</CENTER>
</DIV>
</BODY>
</HTML>
<% Sub rsSubscribe()
Dim rsEmail
On Error Resume Next
Set rsEmail = Server.CreateObject("ADODB.Recordset")
rsEmail.open "email", conn, 3, 3
If err <> "0" Then mailerror() End If
rsEmail.Find "email LIKE '"& email &"'"
If rsEmail.EOF Then
Response.Redirect("add.asp?subscribe="& email)
Else
Response.Write"<p></p><b>" & listname & " Status: Email Found. </b>"&_
"<br>The Email Address <font color='#FF0000'>" & email & "</font> is already"&_
"<br>in our " & listname & " List."&_
"<br><br><a href='java script:self.history.go(-1)'>Please go Back</a><p> </p>"
End If
rsEmail.Close
Set rsEmail = Nothing
End Sub %>
<% Sub rsUnsubscribe()
Dim intValidEmail
intValidEmail = chkEmail(email)
If intValidEmail = 1 Then
Response.Write"<p></p><b>" & listname & " Status: Invalid Email. </b>"&_
"<br>The entered email address does not appear to be a valid email."&_
"<br><a href='java script:self.history.go(-1)'>Please try again</a><p> </p>"
Else
Response.Redirect("u.asp?u="& email)
End If
End Sub %>
<% Function chkEmail(email)
dim atCnt, i
chkEmail = 0
if len(email) < 5 then
chkEmail = 1
elseif instr(email,"@") = 0 then
chkEmail = 1
elseif instr(email,".") = 0 then
chkEmail = 1
elseif len(email) - instrrev(email,".") > 3 then
chkEmail = 1
elseif instr(email,"_") <> 0 and _
instrrev(email,"_") > instrrev(email,"@") then
chkEmail = 1
else
atCnt = 0
for i = 1 to len(email)
if mid(email,i,1) = "@" then
atCnt = atCnt + 1
end if
next
if atCnt > 1 then
chkEmail = 1
end if
for i = 1 to len(email)
if not isnumeric(mid(email,i,1)) and _
(lcase(mid(email,i,1)) < "a" or _
lcase(mid(email,i,1)) > "z") and _
mid(email,i,1) <> "_" and _
mid(email,i,1) <> "." and _
mid(email,i,1) <> "@" and _
mid(email,i,1) <> "-" then
chkEmail = 1
end if
next
end if
End Function %>
<% Function mailerror()
Response.Clear
Dim path
path = Request.ServerVariables("PATH_TRANSLATED")
Response.Write"<p>"</p><center><table><tr><td width='500'>"&_
"<b>A Error as Occurred:</b><br><br>"&_
"<b>Error # </b>" & err.number & "<BR>"&_
"<b>Source - </b>" & err.source & "<BR>"&_
"<b>ASP Page - </b>" & path & "<BR>"&_
"<b>Description - </b>" & err.description & "<BR><br>"&_
"Please check that all your paths and that the correct path to the database"&_
" is in your conn.asp file. Also check that you are using the right mail component. If you are still having"&_
" a problem, visit our helpdesk and include the above information. <a href = '
http://www.doitasp.com/helpdesk/' target='_blank'>HELP DESK</a>"&_
"</td></tr></table>"
err.clear
Response.End
End Function
%>
<%
conn.Close
Set conn = nothing
%>