"Steven Burn" <so*******@in-time.invalidwro te in message
news:eu******** ******@TK2MSFTN GP05.phx.gbl...
Write code to filter the spam ....
If you can post the code for spBoardPost.asp , one of us will probably be
able to do it for you if you can't.
Hi Steven,
Thanks for your reply. No problem posting the code as it belongs to a
public domain message board called simply 'ASPBoard'. I picked it up
somewhere, probably PSC.
How would you go about filtering the spam ? By individual domain or
something?
TIA,
PW
Code below ...
--------------------------------------------------
aspBoardPost.as p
--------------------------------------------------
<%@ Language=VBScri pt %>
<%Option Explicit%>
<%Response.Buff er=True%>
<!--#INCLUDE FILE="aspBoardF unctions.asp"-->
<HTML>
<HEAD>
<%
Dim lngNewId
Dim strMsgLabel
Dim strTitleLabel
Dim strHeaderString
Dim strDetailString
If Request("author _nameStr")<"" Then
With Response
.Cookies("postN ame") = Request("author _nameStr")
.Cookies("postN ame").Expires = DateAdd("yyyy", 1,Date)
.Cookies("postE mail") = Request("author _emailStr")
.Cookies("postE mail").Expires = DateAdd("yyyy", 1,Date)
.Cookies("postU rl") = Request("author _urlStr")
.Cookies("postU rl").Expires = DateAdd("yyyy", 1,Date)
End With
strDetailString = Request("detail Str")
If Request("incOri g") = "yes" Then
strDetailString = strDetailString & aspCrLf & " In response to: " &
aspCrLf & Request("origMs gStr")
End If
lngNewId = AddResponse(Req uest("msgId"), Request("header Str"),
strDetailString , Request("author _nameStr"), Request("author _emailStr") & "",
Request("author _urlStr") & "")
Response.Redire ct "aspBoardDetail .asp?Id=" & lngNewId
End If
If Request.QuerySt ring("Id") 0 Then
strMsgLabel = "Your Response"
strTitleLabel = "Post a Follow-Up to:"
Else
strMsgLabel = "Your Message"
strTitleLabel = "Post a new thread"
End If
%>
<TITLE><%=abTit le%> <%=st rTitleLabel%></TITLE>
</HEAD>
<%
If abBGImage="" Then
If abBGColor <"" Then
Response.Write "<BODY BGCOLOR=""" & abBGColor & """>"
End If
Else
Response.Write "<BODY BACKGROUND=""" & abBGImage & """>"
End If
strHeaderString = GetHeaderString (Request.QueryS tring("Id"), 0)
%>
<CENTER>
<%=GetTitleStri ng%>
<h4><font face="<%=abFont %>"><%=strTitle Label%><br>
<a href="aspBoardD etail.asp?Id=<% =Request.QueryS tring("Id")%>">
<font color="#ff0000" ><%=strHeaderSt ring%></font></a></h4>
</CENTER>
<%
Dim adoRs
strSql="SELECT * FROM msgDetail WHERE msgId = " & Request.QuerySt ring("Id")
Set adoRs=Server.Cr eateObject("ADO DB.Recordset")
adoRS.Open strSql, adoConn, 1
If strHeaderString <abDefaultHeade r Then
strHeaderString = "RE: " & strHeaderString
End If
%>
<center>
<table width="80%" cellpadding="2" cellspacing="2" border="0">
<form method="post" action="aspBoar dPost.asp" id="postForm" name="postForm"
LANGUAGE="javas cript" onsubmit="retur n Submit_onclick( )">
<tr>
<td><font face="<%=abFont %>" size="-1"><b>Your Name:</b></font></td>
<td><input id="author_name Str" name="author_na meStr" type="text"
size="24" Value="<%=Reque st.Cookies("pos tName")%>"></td>
</tr>
<tr>
<td><font face="<%=abFont %>" size="-1"><b>Your Email:</b></font></td>
<td><input id="author_emai lStr" name="author_em ailStr" type="text"
size="24" Value="<%=Reque st.Cookies("pos tEmail")%>"></td>
</tr>
<tr>
<td><font face="<%=abFont %>" size="-1"><b>Your URL:</b></font></td>
<td><input id="author_urlS tr" name="author_ur lStr" type="text" size="24"
Value="<%=Reque st.Cookies("pos tURL")%>"></td>
</tr>
<tr>
<td><font face="<%=abFont %>" size="-1"><b>Subjec t:</b></font></td>
<td><input id="headerStr" name="headerStr " type="text" size="48"
value="<%=strHe aderString%>"></td>
</tr>
<tr>
<td><font face="<%=abFont %>"
size="-1"><b><%=strMsg Label%>:</b></font></td>
<td><textarea cols="48" rows="5" name="detailStr "
id="detailStr"> </textarea></td>
</tr>
<%If Request.QuerySt ring("Id") 0 Then%>
<%If abIncOrigMsg = True Then%>
<tr><td colspan="2">&nb sp;</td></tr>
<tr valign="top">
<td> </td>
<td><input type="checkbox" name="incOrig" Value="yes" CHECKED>
<font face="<%=abFont %>" size="-1"><b>Includ e original message in
response?<br></td>
</tr>
<%End If%>
<tr><td colspan="2">&nb sp;</td></tr>
<tr>
<td> </td>
<td><font face="<%=abFont %>" size="-1">Posted by
<%=adoRs.Fields ("author_nameSt r").Value%>&nbs p;on <%=Fo rmatDateTime(ad oRs.Fields("msg Time").Value,
1)%> at&nb sp;<%=FormatDat eTime(adoRs.Fie lds("msgTime"). Value,
3)%></font></td>
</tr>
<tr>
<td valign="top"><f ont face="<%=abFont %>" size="-1"><b>Origin al
Message:</b></font></td><td><textare a cols="48"
rows="<%=GetRow s(adoRs.Fields( "detailStr").Va lue)%>" id="origMsg1"
name="origMsg1" disabled><%=Rep laceQuotes(adoR s.Fields("detai lStr").Value,
0)%></textarea></td>
</tr>
<input type="hidden" id="origMsgStr " name="origMsgSt r"
value="<%=adoRs .Fields("detail Str").Value%>" >
<%End If%>
<input type="hidden" id="msgId" name="msgId"
value="<%=Reque st.QueryString( "Id")%>">
<tr>
<td colspan="2" align="center">
<input type="submit" value="Post Message" Name="Submit">
</td>
</tr>
</form>
</table>
<br>
</center>
</BODY>
</HTML>
<SCRIPT ID=clientEventH andlersJS LANGUAGE=javasc ript>
<!--
function Submit_onclick( ) {
//check for client side (form) validation
if (Form_Validate( ) == true) {
return true;
} else {
return false;
}
}
//-->
</SCRIPT>
<SCRIPT Language="JavaS cript">
function Form_Validate() {
if (document.postF orm.author_name Str.value==""){
alert("[Your Name] cannot be blank");
return false;
}
if (document.postF orm.author_emai lStr.value=="") {
alert("[Your Email] cannot be blank");
return false;
}
if (document.postF orm.detailStr.v alue==""){
alert("[Your Response] cannot be blank");
return false;
}
return true;
}
</SCRIPT>