Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Add AntiSpam to Contact Form
 New Topic  Topic Locked
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 3

leatherlips
Senior Member

USA
1838 Posts

Posted - 02 March 2009 :  20:24:37  Show Profile  Visit leatherlips's Homepage
Looking at the source code when the page is in the browser the number gifs are still being shown. For example, this is what you see in the source code:

<img src="images/9.gif" border="0" alt="PicCode">
<img src="images/4.gif" border="0" alt="PicCode">
<img src="images/4.gif" border="0" alt="PicCode">
<img src="images/1.gif" border="0" alt="PicCode">
<img src="images/6.gif" border="0" alt="PicCode">
<img src="images/9.gif" border="0" alt="PicCode">

Any other ideas?

Also, how can you hide the email address in the source code? For example, if you email a member from their profile page, their email address is not revealed in the source code.

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD

Edited by - leatherlips on 02 March 2009 20:53:43
Go to Top of Page

TastyNutz
Junior Member

USA
251 Posts

Posted - 02 March 2009 :  22:28:58  Show Profile  Visit TastyNutz's Homepage
I recently needed some CAPTCHA code for a non-Snitz contact form, and I ran across this topic. I tried CareFree's code and it works great. But I was also concerned about the image src being visible. So, I tried using the antispam code from the Guestbook mod instead (Sorry Carefree! ).

I put it into your contact.asp if you're interested.




<%
'###############################################################################
'##
'## Snitz Forums 2000 v3.4.06
'##
'###############################################################################
'##
'## Copyright © 2000-06 Michael Anderson, Pierre Gorissen,
'## Huw Reddick and Richard Kinser
'##
'## This program is free. You can redistribute and/or modify it under the
'## terms of the GNU General Public License as published by the Free Software
'## Foundation; either version 2 or (at your option) any later version.
'##
'## All copyright notices regarding Snitz Forums 2000 must remain intact in
'## the scripts and in the HTML output. The "powered by" text/logo with a
'## link back to http://forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet.
'##
'## This program is distributed in the hope that it will be useful but
'## WITHOUT ANY WARRANTY; without even an implied warranty of MERCHANTABILITY
'## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
'## for more details.
'##
'## You should have received a copy of the GNU General Public License along
'## with this program; if not, write to:
'##
'## Free Software Foundation, Inc.
'## 59 Temple Place, Suite 330
'## Boston, MA 02111-1307
'##
'## Support can be obtained from our support forums at:
'##
'## http://forum.snitz.com
'##
'## Correspondence and marketing questions can be sent to:
'##
'## manderson@snitz.com
'##
'###############################################################################
%>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_sha256.asp" -->
<!--#INCLUDE FILE="inc_header.asp" -->
<!--#INCLUDE file="inc_func_member.asp" -->
<%
if Request.QueryString("mode") = "DoIt" then
Err_Msg = ""
RandCode = Request.Form("code")
strRCCode = Request.Form("Coder")
RandCode2 = (strRCCode + 17456) / 50000
lenCode = Len(RandCode2)
NullStop = False
If LenCode < 6 and Nullstop = False then
For J = 1 to (6 - LenCode)
NullRC = NullRC & "0"
Next
NullStop = True
End If
RandCode2 = NullRC & RandCode2
if RandCode = "" then
Err_Msg = Err_Msg & "<li>Please enter the authentication code.</li>"
end if
If RandCode <> RandCode2 then
Err_Msg = Err_Msg & "<li>The confirmation code you have entered is not correct!</li>"
End If
if (Request.Form("YName") = "") then
Err_Msg = Err_Msg & "<li>You must enter your name</li>"
end if
if (Request.Form("YEmail") = "") then
Err_Msg = Err_Msg & "<li>You must enter your e-mail address</li>"
else
if (EmailField(Request.Form("YEmail")) = 0) then
Err_Msg = Err_Msg & "<li>You Must enter a valid e-mail address</li>"
end if
end if
if (Request.Form("Name") = "") then
Err_Msg = Err_Msg & "<li>You must enter the recipients name</li>"
end if
if (Request.Form("Email") = "") then
Err_Msg = Err_Msg & "<li>You Must enter the recipients e-mail address</li>"
else
if (EmailField(Request.Form("Email")) = 0) then
Err_Msg = Err_Msg & "<li>You Must enter a valid e-mail address for the recipient</li>"
end if
end if
if (Request.Form("Msg") = "") then
Err_Msg = Err_Msg & "<li>You Must enter a message</li>"
end if
if lcase(strEmail) = "1" then
if (Err_Msg = "") then
strRecipientsName = Request.Form("Name")
strRecipients = Request.Form("Email")
strSubject = strForumTitle
strMessage = Request.Form("Msg") & vbNewline & vbNewline
strMessage = strMessage & "You received this from : " & Request.Form("YName") & " (" & Request.Form("YEmail") & ") "
strFromName = Request.Form("YName")
strSender = Request.Form("YEmail")
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
Response.Write("<p><b><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """><center><br>Your email has been sent</center></font></b></p>" & vbNewLine)
Response.write " <p align=""center""><font size=""" & strDefaultFontSize & """ align=""center""><a href=""JavaScript:history.go(-2)"">Go Back</a></font></p><br /><br />" & vbNewLine
else
Response.Write("<p><b><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """><center><br>There Was A Problem</center></font></b></p>" & vbNewLine)
Response.Write "<table align=""center"">" & vbNewLine & _
"<tr>" & vbNewLine & _
"<td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
"</tr>" & vbNewLine & _
"</table>" & vbNewLine
Response.Write("<p><font size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)""><center>Go Back To Enter Data</center></a><br><br></font></p>" & vbNewLine)
end if
end if
else
' ## Forum_SQL
strSql ="SELECT M_NAME, M_USERNAME, M_EMAIL "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS"
strSql = strSql & " WHERE MEMBER_ID = " & intAdminMemberID & ""
set rs = my_conn.Execute (strSql)
if (rs.EOF or rs.BOF)then
Err_Msg = Err_Msg & "<li>The Administrator's account could not be located</li>"
Response.Write("<p><b><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """><center>There Was A Problem</center></font></b></p>" & vbNewLine)
Response.Write "<table align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
"</table>" & vbNewLine
set rs = nothing
Response.Write("<p><font size=""" & strDefaultFontSize & """><a href=""JavaScript:onClick= window.close()"">Close Window</A></font></p>" & vbNewLine)
Response.End
else
Name = Trim("" & rs("M_NAME"))
Email = Trim("" & rs("M_EMAIL"))
end if
rs.close
set rs = nothing
Response.Write "<form action=""contact.asp?mode=DoIt"" method=""post"" id=""Form1"" name=""Form1"">" & vbNewLine & _
" <input type=""hidden"" name=""Page"" value=""" & Request.QueryString & """>" & vbNewLine & _
" <input type=""hidden"" name=""Name"" value=""" & Name & """>" & vbNewLine & _
" <input type=""hidden"" name=""Email"" value=""" & Email & """>" & vbNewLine & _
" <br><table align=""center"" border=""0"" width=""95%"" cellspacing=""0"" cellpadding=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strPopUpBorderColor & """>" & vbNewLine & _
" <table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""4"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td colspan=""2"" bgColor=""" & strHeadCellColor & """ align=""center"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>Contact Mangione Magic</font></b></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Your Name:</font></b></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><input type=""text"" name=""YName"" size=""25""></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Your E-mail:</font></b></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><input type=""text"" name=""YEmail"" size=""25""></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""top"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Message:</font></b></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><textarea name=""Msg"" id=""msg"" cols=""50"" rows=""10""></textarea><div><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ id=""msg-status""></div></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""top"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Type the Code Below</font></b></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """>" & vbNewLine
strRCCode = Request.QueryString("rc")
strRC = Request.QueryString("code")
strRCP = Request.QueryString("p")
If strRC = "image" then
NullStop = False
RandCode = (strRCCode + 17456) / 50000
lenCode = Len(RandCode)
If LenCode < 6 and Nullstop = False then
For J = 1 to (6 - LenCode)
NullRC = NullRC & "0"
Next
NullStop = True
End If
RandCode = NullRC & RandCode
ImageP = Mid(RandCode, strRCP,1)
Response.Redirect "images/" & ImageP & ".gif"
End If

HowManyNbr=6
NumbersToShow = ""
Randomize
For I = 1 to HowManyNbr
NumbersToShow = NumbersToShow & Fix(9*Rnd)
Next
RandomizedCode = NumbersToShow * 50000 - 17456
NullStop = False
For I = 1 to HowManyNbr
Response.Write " <img src='pop_contact_admin.asp?code=image&rc=" & RandomizedCode &"&p=" & I & "' border='0' alt='Code' width='31' height='41'>"
Next
Response.Write " </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <input type=""hidden"" name=""Coder"" value=""" & RandomizedCode & """>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ colspan=""2"" align=""center""><input type=""text"" name=""code"" size=""" & HowManyNbr & """ maxlength=""" & HowManyNbr & """></td>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ colspan=""2"" align=""center""><input type=""submit"" value=""Send"" id=""Submit1"" name=""Submit1""></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
"</form>" & vbNewLine & _
"<script type=""text/javascript"">" & vbNewLine & _
" fieldlimiter.setup({" & vbNewLine & _
" thefield: document.getElementById(""msg"")," & vbNewLine & _
" maxlength: 500," & vbNewLine & _
" statusids: [""msg-status""]," & vbNewLine & _
" onkeypress:function(maxlength, curlength){" & vbNewLine & _
"}" & vbNewLine & _
"})" & vbNewLine & _
"</script>" & vbNewLine
end if

WriteFooter
Response.End
%>



PowerQuad Disability Support Forum

Edited by - TastyNutz on 02 March 2009 22:44:52
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 03 March 2009 :  00:53:37  Show Profile
quote:
Originally posted by TastyNutz

I recently needed some CAPTCHA code for a non-Snitz contact form, and I ran across this topic. I tried CareFree's code and it works great. But I was also concerned about the image src being visible. So, I tried using the antispam code from the Guestbook mod instead (Sorry Carefree! ).

No problem. I redid it using that form of anti-spam coding and using a drop-down list of admins/mods that doesn't display any email addresses, etc. Change line 47 to modify the length of the code.

<%
'###############################################################################
'##
'## 	                Snitz Forums 2000 v3.4.06
'##
'###############################################################################
'##
'## Copyright © 2000-06 Michael Anderson, Pierre Gorissen,
'## 	                Huw Reddick and Richard Kinser
'##
'## This program is free. You can redistribute and/or modify it under the
'## terms of the GNU General Public License as published by the Free Software
'## Foundation; either version 2 or (at your option) any later version.
'##
'## All copyright notices regarding Snitz Forums 2000 must remain intact in
'## the scripts and in the HTML output.  The "powered by" text/logo with a
'## link back to http://forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet.
'##
'## This program is distributed in the hope that it will be useful but
'## WITHOUT ANY WARRANTY; without even an implied warranty of MERCHANTABILITY
'## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
'## for more details.
'##
'## You should have received a copy of the GNU General Public License along
'## with this program; if not, write to:
'##
'##		        Free Software Foundation, Inc.
'##		        59 Temple Place, Suite 330
'##		        Boston, MA 02111-1307
'##
'## Support can be obtained from our support forums at:
'##
'## 		        http://forum.snitz.com
'##
'## Correspondence and marketing questions can be sent to:
'##
'## 		        manderson@snitz.com
'##
'###############################################################################
%>
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<!--#INCLUDE FILE="inc_func_member.asp" -->
<%
HowManyNbr=6
Function StaffSearch
	dim meMEMBER_ID, meM_NAME, meM_EMAIL, strM1, strM2
	Response.Write	"<select name=""Staff"">" & vbNewLine & _
		"	<option value="""">Choose a Staff Member</option>" & vbNewLine
			strSql = "SELECT MEMBER_ID, M_NAME, M_EMAIL "
			strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS"
			strSql = strSql & " WHERE M_STATUS = " & 1 & "AND M_LEVEL > " & 1
			strSql = strSql & " ORDER BY M_LEVEL DESC, M_NAME ASC;"
		set rs = Server.CreateObject("ADODB.Recordset")
		rs.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
		if rs.EOF then
			recMemberCount = ""
		else
			allMemberData = rs.GetRows(adGetRowsRest)
			recMemberCount = UBound(allMemberData,2)
			meMEMBER_ID = 0
			meM_NAME = 1
			meM_EMAIL = 2
		end if
		rs.close
		set rs = nothing

	if recMemberCount <> "" then
		for iMember = 0 to recMemberCount
			MembersMemberID = allMemberData(meMEMBER_ID, iMember)
			MembersMemberName = allMemberData(meM_NAME, iMember)
			MembersMemberEmail = allMemberData(meM_EMAIL, iMember)
			Response.Write	"	<option value=""" & MembersMemberID & """>" & ChkString(MembersMemberName,"display") & "</option>" & vbCrLf
		next
	end if
	Response.Write	"</select>" & vbNewLine
End Function

if Request.QueryString("mode") = "DoIt" then
	if MembersMemberID > "0" then
		intMemberID = MembersMemberID
		strSql = "SELECT M_EMAIL, M_NAME FROM " & strMemberTablePrefix & "MEMBERS" &_
			" WHERE MEMBER_ID = " & intMemberID
		set rsID = my_Conn.Execute (strSql)
		strRecipientsName = rsID("M_NAME")
		strRecipients = rsID("M_EMAIL")
		rsID.close
		set rsID = nothing
	else
		intMemberID = 0
	end if
	if strRecipientsName = "" then
		strSql = "SELECT M_NAME, M_EMAIL FROM " & strMemberTablePrefix & "MEMBERS WHERE MEMBER_ID=" & intAdminMemberID
		set rs = Server.CreateObject("ADODB.Recordset")
		rs.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
		if rs.EOF then
			'No super admin exists - you have a problem
		end if
		strRecipientsName=rs("M_NAME")
		strRecipients=rs("M_EMAIL")
	end if
	Err_Msg = ""
	RandCode = Request.Form("code")
	strRCCode = Request.Form("Coder")
	RandCode2 = (strRCCode + 17456) / 50000
	lenCode = Len(RandCode2)
	NullStop = False
	If LenCode < HowManyNbr and Nullstop = False then
		For J = 1 to (HowManyNbr - LenCode)
			NullRC = NullRC & "0"
		Next
		NullStop = True
	End If
	RandCode2 = NullRC & RandCode2
	if RandCode = "" then
		Err_Msg = Err_Msg & "<li>Please enter the authentication code.</li>"
	end if
	If RandCode <> RandCode2 then
		Err_Msg = Err_Msg & "<li>The confirmation code you have entered is not correct!</li>"
	End If
	strSubject = strForumTitle & " - Contact Us"
	strMessage = Request.Form("CUMsg") & vbNewline & vbNewline
	strMessage = strMessage & "Author : " & Request.Form("CUName")
	strFromName = Request.Form("CUName")
	strSender = Request.Form("CUEmail")
	if strRecipientsName = "" then
		if strSender = "" then
			if strFromName = "" & MEMBER_ID = 0 then
				Err_Msg = Err_Msg & "<li>You must enter your name.</li>"
			end if
		end if
		if strSender = "" then
			if Request.Form("CUEmail") = "" then
				Err_Msg = Err_Msg & "<li>You must enter your e-mail address.</li>"
			else
				if EmailField(Request.Form("CUEmail")) = 0 then
					Err_Msg = Err_Msg & "<li>EMail address is invalid.</li>"
				end if
			end if
		end if
	end if
	if strMessage = "" then
		Err_Msg = Err_Msg & "<li>You must enter a message.</li>"
	end if
	if lcase(strEmail) = "1" then
		if (Err_Msg = "") then
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
			Response.Write	"	<p><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><center>Your message has been sent.</center></font></b></p>" & vbNewLine & _
				" <p align=""center""><font size=""" & strDefaultFontSize & """ align=""center""><a href=""JavaScript:history.go(-3)"">Go Back</a></font></p><br /><br />" & vbNewLine
		else
			Response.Write("	<p><b><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """><center>There Was a Problem.</center></font></b></p>") & vbNewLine & _
				"<table align=""center"">" & vbNewLine & _
				"	<tr>" & vbNewLine & _
				"		<td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul>" & vbNewLine & _
				"		</font></td>" & vbNewLine & _
				"	</tr>" & vbNewLine & _
				"</table>" & vbNewLine & _
				"<p><font size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)""><center>Go back to correct data.</center></a></font></p>" & vbNewLine
  	end if
  end if
else
	Response.Write "<form action=""pop_contact_admin.asp?mode=DoIt"" method=""post"" id=""Form"" name=""Form"">" & vbNewLine & _
		"	<table bgColor=""" & strTableBorderColor & """ align=""center"" border=""1"" width=""60%"" cellspacing=""1"" cellpadding=""2"">" & vbNewLine & _
		"		<tr>" & vbNewLine & _
		"			<td width=""100%"" bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
		"				<table bgColor=""" & strTableBorderColor & """ style=""border-collapse: collapse"" border=""1"" width=""100%"" cellspacing=""1"" cellpadding=""4"">" & vbNewLine & _
		"					<tr>" & vbNewLine & _
		"						<td width=""98%"" bgColor=""" & strAltForumCellColor & """ align=""center"" nowrap><b>" & vbNewLine & _
		"							<font face=""" & strHeadFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strForumFontColor & """>Contact Us" & vbNewLine & _
		"							</font></b>" & vbNewLine & _
		"						</td>" & vbNewLine & _
		"					</tr>" & vbNewLine & _
		"				</table>" & vbNewLine & _
		"				<table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""2"">" & vbNewLine & _
		"					<tr>" & vbNewLine & _
		"						<td colspan=""2"" width=""98%"" bgColor=""" & strForumFirstCellColor & """ align=""center"">" & vbNewLine & _
		"						</td>" & vbNewLine & _
		"					</tr>" & vbNewLine & _
		"					<tr>" & vbNewLine & _
		"						<td colspan=""1"" width=""49%"" bgColor=""" & strForumCellColor & """ align=""right""><b>" & vbNewLine & _
		"							<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Choose Staff Member:" & vbNewLine & _
		"							</font></b>" & vbNewLine & _
		"						</td>" & vbNewLine & _
		"						<td colspan=""1"" width=""49%"" bgColor=""" & strForumCellColor & """ align=""left""><b>" & vbNewLine
	StaffSearch
	Response.Write	"						</td>" & vbNewLine & _
		"					</tr>" & vbNewLine & _
		"					<tr>" & vbNewLine & _
		"						<td colspan=""1"" width=""49%"" bgColor=""" & strForumCellColor & """ align=""right""><b>" & vbNewLine & _
		"							<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Your Name:" & vbNewLine & _
		"							</font></b>" & vbNewLine & _
		"						</td>" & vbNewLine & _
		"						<td colspan=""1"" width=""49%"" align=""left"" bgColor=""" & strForumCellColor & """><input type=""text"" name=""CUName"" value=""" & CUName & """ size=""30"">" & vbNewLine & _
		"						</td>" & vbNewLine & _
		"					</tr>" & vbNewLine & _
		"					<tr>" & vbNewLine & _
		"						<td colspan=""1"" width=""49%"" bgColor=""" & strForumCellColor & """ align=""right""><b>" & vbNewLine & _
		"							<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Your E-mail:" & vbNewLine & _
		"							</font></b>" & vbNewLine & _
		"						</td>" & vbNewLine & _
		"						<td colspan=""1"" width=""49%"" align=""left"" bgColor=""" & strForumCellColor & """><input type=""text"" name=""CUEmail"" value=""" & CUEmail & """ size=""30"">" & vbNewLine & _
		"						</td>" & vbNewLine & _
		"					</tr>" & vbNewLine & _
		"					<tr>" & vbNewLine & _
		"						<td width=""98%"" colspan=""2"" bgColor=""" & strForumCellColor & """ align=""left"">" & vbNewLine & _
		"							<font face=""" & strFooterFontFace & """ size=""" & strFooterFontSize & """> <br>" & vbNewLine & _
		"							</font>" & vbNewLine & _
		"							<font face=""" & strHeadFontFace & """ size=""" & strHeadFontSize & """><b>Message:</b>" & vbNewLine & _
		"							</font>" & vbNewLine & _
		"						</td>" & vbNewLine & _
		"					</tr>" & vbNewLine & _
		"					<tr>" & vbNewLine & _
		"						<td width=""98%"" colspan=""2"" align=""center"" valign=""top"" nowrap><b>" & vbNewLine & _
		"							<textarea class=""bgd"" align=""left"" id=""CUMsg"" cols=""80"" rows=""9"" wrap=""VIRTUAL""></textarea>" & vbNewLine & _
		"						</td>" & vbNewLine & _
		"					</tr>" & vbNewLine & _
		"				</table>" & vbNewLine & _
		"				<table border=""0"" style=""border-collapse: collapse"" width=""100%"" cellspacing=""0"" cellpadding=""0"">" & vbNewLine & _
		"					<tr>" & vbNewLine & _
		"						<td width=""98%"" colspan=""2"" bgColor=""" & strAltForumCellColor & """ align=""center"" valign=""top"" nowrap><b><font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Type the Code Below</font></b></td>" & vbNewLine & _
		"					</tr>" & vbNewLine & _
		"					<tr>" & vbNewLine & _
		"						<td width=""98%"" colspan=""2"" align=""center"" bgColor=""" & strAltForumCellColor & """>" & vbNewLine

	strRCCode = Request.QueryString("rc")
	strRC = Request.QueryString("code")
	strRCP = Request.QueryString("p")
	If strRC = "image" then
		NullStop = False
		RandCode = (strRCCode + 17456) / 50000
		lenCode = Len(RandCode)
		If LenCode < HowManyNbr and Nullstop = False then
			For J = 1 to (HowManyNbr - LenCode)
				NullRC = NullRC & "0"
			Next
			NullStop = True
		End If
		RandCode = NullRC & RandCode
		ImageP = Mid(RandCode, strRCP,1)
		Response.Redirect "images/" & ImageP & ".gif"
	End If

	NumbersToShow = ""
	Randomize
	For I = 1 to HowManyNbr
		NumbersToShow = NumbersToShow & Fix(9*Rnd)
	Next
	RandomizedCode = NumbersToShow * 50000 - 17456
	NullStop = False
	For I = 1 to HowManyNbr
		Response.Write  "							<img src='contact_admin.asp?code=image&rc=" & RandomizedCode &"&p=" & I & "' border='0' alt='Code'>"
	Next
	Response.Write	"						</td>" & vbNewLine & _
		"					</tr>" & vbNewLine & _
		"						<input type=""hidden"" name=""Coder"" value=""" & strCd & """>" & vbNewLine & _
		"					<tr>" & vbNewLine & _
		"						<td width=""98%"" bgColor=""" & strAltForumCellColor & """ colspan=""2"" align=""center""><input type=""text"" name=""code"" size=""" & HowManyNbr & """ maxlength=""" & HowManyNbr & """></td>" & vbNewLine & _
		"					<tr>" & vbNewLine & _
		"				</table>" & vbNewLine & _
		"			</td>" & vbNewLine & _
		"		</tr>" & vbNewLine & _
		"	</table>" & vbNewLine & _
		"	<p><center><input class=""bdn"" type=""submit"" value=""EMail It!"" id=""Submit"" name=""Submit""></center></p>" & vbNewLine & _
		"</form>" & vbNewLine & _
		"<script type=""text/javascript"">" & vbNewLine & _
		"	fieldlimiter.setup({" & vbNewLine & _
		"	thefield: document.getElementById(""msg"")," & vbNewLine & _
		"	maxlength: 500," & vbNewLine & _
		"	statusids: [""msg-status""]," & vbNewLine & _
		"	onkeypress:function(maxlength, curlength){" & vbNewLine & _
		"}" & vbNewLine & _
		"})" & vbNewLine & _
		"</script>" & vbNewLine
end if
WriteFooter
Response.End
%>

Edited by - Carefree on 03 March 2009 01:16:26
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 03 March 2009 :  08:06:02  Show Profile  Visit leatherlips's Homepage
Thanks guys for the two different approaches. However, they each have a problem. TastyNutz - yours will not accept the code. After you enter it, it still says it is invalid. I have it here.

Carefree - Yours gives a mismatch error.

Microsoft VBScript runtime error '800a000d' 

Type mismatch: 'strRCCode' 

/forum/carefree.asp, line 107

I have it here.

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD

Edited by - leatherlips on 03 March 2009 08:06:26
Go to Top of Page

TastyNutz
Junior Member

USA
251 Posts

Posted - 03 March 2009 :  09:12:06  Show Profile  Visit TastyNutz's Homepage
quote:
Originally posted by leatherlips

TastyNutz - yours will not accept the code. After you enter it, it still says it is invalid.


I tested again on my server and it's working. As Carefree pointed out before, be sure your form action has the correct file name. I'm betting that's the problem, since your error message text is different, so it must be using the wrong file (unless you changed the error text).

Got a text file I can see?


PowerQuad Disability Support Forum
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 03 March 2009 :  09:29:37  Show Profile  Visit leatherlips's Homepage
TastyNutz, you were correct. I thought I had changed the form action but missed that one. Now the only thing I need to try to work on is having my email address not show up in the source code.

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page

TastyNutz
Junior Member

USA
251 Posts

Posted - 03 March 2009 :  09:30:55  Show Profile  Visit TastyNutz's Homepage
quote:
Originally posted by Carefree


No problem. I redid it using that form of anti-spam coding ...


That seems the way to go. I left a contact form online with your original code, and I woke up to a dozen automated spam emails.

But my guestbook hasn't been spammed once in the years since adding the anti-spam code.


PowerQuad Disability Support Forum
Go to Top of Page

TastyNutz
Junior Member

USA
251 Posts

Posted - 03 March 2009 :  09:43:52  Show Profile  Visit TastyNutz's Homepage
quote:
Originally posted by leatherlips

Now the only thing I need to try to work on is having my email address not show up in the source code.


I never noticed that. The whole purpose of the contact form is to hide the address, but it's been exposed anyway. D'oh!


PowerQuad Disability Support Forum

Edited by - TastyNutz on 03 March 2009 09:44:42
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 03 March 2009 :  17:11:53  Show Profile  Visit leatherlips's Homepage
I think I finally have everything resolved. Now the number gif's are hidden and my email address and name is hidden in the source code. It seems to be working fine. I used the email riddler tool at dynamic drive and it works great (so far as I can tell). If you're interested in applying the riddler tool to your page, let me know and I'll post my pages code.

Here is my final version of my contact page.

Thanks so much for your help Carefree and TastyNutz! You guys rock!

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD

Edited by - leatherlips on 03 March 2009 17:12:22
Go to Top of Page

texanman
Junior Member

United States
410 Posts

Posted - 03 March 2009 :  18:46:06  Show Profile
Please post your code. I was using a contact us form before as well and was faced with the problem you faced. I had to abandon the idea because of the spams. Thanks all.
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 03 March 2009 :  19:17:24  Show Profile  Visit leatherlips's Homepage
The way I did it makes it a little hard to post the code for it to work for anyone else. However, I will try to explain a few things I have in my form. First, here is the code[/url] of my contact.asp page in text form. Just copy and paste it and name your file contact.asp.

On my page I am also using a character count script that limits the message length. I have mine set to 500. This can be changed at line 230. For this to work you also must have the corresponding .js file. Just copy this code name it formfieldlimiter.js and add it with your other forum files.

Then add this line in your inc_header.asp page:

Response.Write "<script type=""text/javascript"" src=""formfieldlimiter.js""></script>" & vbNewLine

It should go below the second instance of this line:

'## END   - REMOVAL, MODIFICATION OR CIRCUMVENTING THIS CODE WILL VIOLATE THE SNITZ FORUMS 2000 LICENSE AGREEMENT

You will then need to go to the Dynamic Drive Email Riddler page and enter your email address. Then click the Output variable only (nothing shown) option. Then finally click the "Encrypt Email" button. You then need to replace my code at lines 144-151 with your code. Notice the format it will need to be changed to in order for it to work with the asp code. Just use mine as a guide.

Then be sure to change line 224 on the contact.asp page to have your own id as generated by the email riddler.

You will also need to have the anti spam images in a subfolder of your forum called images. You can obtain the images from here.

There are also a few lines you'll need to change in order to reflect your own text: Lines 108, 109 and 162.

I think I've mentioned everything. If you have problems, let me know.

Edit: I forgot another thing I did. I did not want the login box at the top of the contact form so I removed it. This is of course optional. If you want to do it as well, then in inc_header.asp look for this line:
not(Instr(Request.ServerVariables("Path_Info"), "faq.asp") > 0) and _
Below it add:
not(Instr(Request.ServerVariables("Path_Info"), "contact.asp") > 0) and _


Edit by leatherlips: Ignore the above. I have compiled all of the information and changes into a MOD called the Contact Page MOD. You can find it here.

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD

Edited by - leatherlips on 10 March 2009 18:41:59
Go to Top of Page

TastyNutz
Junior Member

USA
251 Posts

Posted - 03 March 2009 :  20:57:50  Show Profile  Visit TastyNutz's Homepage
Or... you can use the file below. I reworked it to remove the admin email from the source code. Much easier.

*Note... if you change the file name, make the corresponding changes at lines 139 and 190.



<%
'###############################################################################
'##
'## Snitz Forums 2000 v3.4.06
'##
'###############################################################################
'##
'## Copyright © 2000-06 Michael Anderson, Pierre Gorissen,
'## Huw Reddick and Richard Kinser
'##
'## This program is free. You can redistribute and/or modify it under the
'## terms of the GNU General Public License as published by the Free Software
'## Foundation; either version 2 or (at your option) any later version.
'##
'## All copyright notices regarding Snitz Forums 2000 must remain intact in
'## the scripts and in the HTML output. The "powered by" text/logo with a
'## link back to http://forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet.
'##
'## This program is distributed in the hope that it will be useful but
'## WITHOUT ANY WARRANTY; without even an implied warranty of MERCHANTABILITY
'## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
'## for more details.
'##
'## You should have received a copy of the GNU General Public License along
'## with this program; if not, write to:
'##
'## Free Software Foundation, Inc.
'## 59 Temple Place, Suite 330
'## Boston, MA 02111-1307
'##
'## Support can be obtained from our support forums at:
'##
'## http://forum.snitz.com
'##
'## Correspondence and marketing questions can be sent to:
'##
'## manderson@snitz.com
'##
'###############################################################################
%>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_sha256.asp" -->
<!--#INCLUDE FILE="inc_header.asp" -->
<!--#INCLUDE file="inc_func_member.asp" -->
<%
' ## Forum_SQL
strSql ="SELECT M_NAME, M_USERNAME, M_EMAIL "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS"
strSql = strSql & " WHERE MEMBER_ID = " & intAdminMemberID & ""
set rs = my_conn.Execute (strSql)
if (rs.EOF or rs.BOF)then
Err_Msg = Err_Msg & "<li>The Administrator's account could not be located</li>"
Response.Write("<p><b><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """><center>There Was A Problem</center></font></b></p>" & vbNewLine)
Response.Write "<table align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
"</table>" & vbNewLine
set rs = nothing
Response.Write("<p><font size=""" & strDefaultFontSize & """><a href=""JavaScript:onClick= window.close()"">Close Window</A></font></p>" & vbNewLine)
Response.End
else
Name = Trim("" & rs("M_NAME"))
Email = Trim("" & rs("M_EMAIL"))
end if
rs.close
set rs = nothing

if Request.QueryString("mode") = "DoIt" then
Err_Msg = ""
RandCode = Request.Form("code")
strRCCode = Request.Form("Coder")
RandCode2 = (strRCCode + 17456) / 50000
lenCode = Len(RandCode2)
NullStop = False
If LenCode < 6 and Nullstop = False then
For J = 1 to (6 - LenCode)
NullRC = NullRC & "0"
Next
NullStop = True
End If
RandCode2 = NullRC & RandCode2
if RandCode = "" then
Err_Msg = Err_Msg & "<li>Please enter the authentication code.</li>"
end if
If RandCode <> RandCode2 then
Err_Msg = Err_Msg & "<li>The confirmation code you have entered is not correct!</li>"
End If
if (Request.Form("YName") = "") then
Err_Msg = Err_Msg & "<li>You must enter your name</li>"
end if
if (Request.Form("YEmail") = "") then
Err_Msg = Err_Msg & "<li>You Must give your e-mail address</li>"
else
if (EmailField(Request.Form("YEmail")) = 0) then
Err_Msg = Err_Msg & "<li>You Must enter a valid e-mail address</li>"
end if
end if
' if (Request.Form("Name") = "") then
' Err_Msg = Err_Msg & "<li>You must enter the recipients name</li>"
' end if
' if (Request.Form("Email") = "") then
' Err_Msg = Err_Msg & "<li>You Must enter the recipients e-mail address</li>"
' else
' if (EmailField(Request.Form("Email")) = 0) then
' Err_Msg = Err_Msg & "<li>You Must enter a valid e-mail address for the recipient</li>"
' end if
' end if
if (Request.Form("Msg") = "") then
Err_Msg = Err_Msg & "<li>You Must enter a message</li>"
end if
if lcase(strEmail) = "1" then
if (Err_Msg = "") then
strRecipientsName = Name
strRecipients = Email
strSubject = strForumTitle
strMessage = Request.Form("Msg") & vbNewline & vbNewline
strMessage = strMessage & "You received this from : " & Request.Form("YName") & " (" & Request.Form("YEmail") & ") "
strFromName = Request.Form("YName")
strSender = Request.Form("YEmail")
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
Response.Write("<p><b><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """><center><br>Your email has been sent</center></font></b></p>" & vbNewLine)
Response.write " <p align=""center""><font size=""" & strDefaultFontSize & """ align=""center""><a href=""JavaScript:history.go(-2)"">Go Back</a></font></p><br /><br />" & vbNewLine
else
Response.Write("<p><b><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """><center><br>There Was A Problem</center></font></b></p>" & vbNewLine)
Response.Write "<table align=""center"">" & vbNewLine & _
"<tr>" & vbNewLine & _
"<td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
"</tr>" & vbNewLine & _
"</table>" & vbNewLine
Response.Write("<p><font size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)""><center>Go Back To Enter Data</center></a><br><br></font></p>" & vbNewLine)
end if
end if
else
Response.Write "<form action=""contact_admin.asp?mode=DoIt"" method=""post"" id=""Form1"" name=""Form1"">" & vbNewLine & _
" <input type=""hidden"" name=""Page"" value=""" & Request.QueryString & """>" & vbNewLine & _
" <br><table align=""center"" border=""0"" width=""95%"" cellspacing=""0"" cellpadding=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strPopUpBorderColor & """>" & vbNewLine & _
" <table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""4"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td colspan=""2"" bgColor=""" & strHeadCellColor & """ align=""center"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>Contact " & strForumTitle & "</font></b></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Your Name:</font></b></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><input type=""text"" name=""YName"" size=""25""></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Your E-mail:</font></b></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><input type=""text"" name=""YEmail"" size=""25""></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""top"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Message:</font></b></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><textarea name=""Msg"" id=""msg"" cols=""50"" rows=""10""></textarea><div><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ id=""msg-status""></div></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""top"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Type the Code Below</font></b></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """>" & vbNewLine
strRCCode = Request.QueryString("rc")
strRC = Request.QueryString("code")
strRCP = Request.QueryString("p")
If strRC = "image" then
NullStop = False
RandCode = (strRCCode + 17456) / 50000
lenCode = Len(RandCode)
If LenCode < 6 and Nullstop = False then
For J = 1 to (6 - LenCode)
NullRC = NullRC & "0"
Next
NullStop = True
End If
RandCode = NullRC & RandCode
ImageP = Mid(RandCode, strRCP,1)
Response.Redirect "images/" & ImageP & ".gif"
End If

HowManyNbr=6
NumbersToShow = ""
Randomize
For I = 1 to HowManyNbr
NumbersToShow = NumbersToShow & Fix(9*Rnd)
Next
RandomizedCode = NumbersToShow * 50000 - 17456
NullStop = False
For I = 1 to HowManyNbr
Response.Write " <img src='contact_admin.asp?code=image&rc=" & RandomizedCode &"&p=" & I & "' border='0' alt='Code' width='31' height='41'>"
Next
Response.Write " </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <input type=""hidden"" name=""Coder"" value=""" & RandomizedCode & """>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ colspan=""2"" align=""center""><input type=""text"" name=""code"" size=""" & HowManyNbr & """ maxlength=""" & HowManyNbr & """></td>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ colspan=""2"" align=""center""><input type=""submit"" value=""Send"" id=""Submit1"" name=""Submit1""></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
"</form>" & vbNewLine & _
"<script type=""text/javascript"">" & vbNewLine & _
" fieldlimiter.setup({" & vbNewLine & _
" thefield: document.getElementById(""msg"")," & vbNewLine & _
" maxlength: 500," & vbNewLine & _
" statusids: [""msg-status""]," & vbNewLine & _
" onkeypress:function(maxlength, curlength){" & vbNewLine & _
"}" & vbNewLine & _
"})" & vbNewLine & _
"</script>" & vbNewLine
end if

WriteFooter
Response.End
%>


PowerQuad Disability Support Forum
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 04 March 2009 :  12:04:53  Show Profile  Visit leatherlips's Homepage
TastyNutz's version is better at hiding the email address in the source compared to what I tried to do. Much easier than what I did above. Here is the version of his that I am using now. It is layed out slightly differently and the error message has been changed a bit. Also, mine is using the character count. If you want to use that then you'll need the js script code - see below. If you don't want that, then you can just delete lines 204-212.

Once again, thanks Carefree and TastyNutz for all your work!

<%
'###############################################################################
'##
'##                   Snitz Forums 2000 v3.4.06
'##
'###############################################################################
'##
'## Copyright © 2000-06 Michael Anderson, Pierre Gorissen,
'##                   Huw Reddick and Richard Kinser
'##
'## This program is free. You can redistribute and/or modify it under the
'## terms of the GNU General Public License as published by the Free Software
'## Foundation; either version 2 or (at your option) any later version.
'##
'## All copyright notices regarding Snitz Forums 2000 must remain intact in
'## the scripts and in the HTML output.  The "powered by" text/logo with a
'## link back to http://forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet.
'##
'## This program is distributed in the hope that it will be useful but
'## WITHOUT ANY WARRANTY; without even an implied warranty of MERCHANTABILITY
'## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
'## for more details.
'##
'## You should have received a copy of the GNU General Public License along
'## with this program; if not, write to:
'##
'##              Free Software Foundation, Inc.
'##              59 Temple Place, Suite 330
'##              Boston, MA 02111-1307
'##
'## Support can be obtained from our support forums at:
'##
'##              http://forum.snitz.com
'##
'## Correspondence and marketing questions can be sent to:
'##
'##              manderson@snitz.com
'##
'###############################################################################
%>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_sha256.asp" -->
<!--#INCLUDE FILE="inc_header.asp" -->
<!--#INCLUDE file="inc_func_member.asp" -->
<%
   '  ## Forum_SQL
   strSql ="SELECT M_NAME, M_USERNAME, M_EMAIL "
   strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS"
   strSql = strSql & " WHERE MEMBER_ID = " & intAdminMemberID & ""
   set rs = my_conn.Execute (strSql)
   if (rs.EOF or rs.BOF)then
      Err_Msg = Err_Msg & "<li>The Administrator's account could not be located</li>"
      Response.Write("<p><b><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """><center>There Was A Problem</center></font></b></p>" & vbNewLine)
      Response.Write "<table align=""center"">" & vbNewLine & _
         "  <tr>" & vbNewLine & _
         "     <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
         "  </tr>" & vbNewLine & _
         "</table>" & vbNewLine
      set rs = nothing
      Response.Write("<p><font size=""" & strDefaultFontSize & """><a href=""JavaScript:onClick= window.close()"">Close Window</A></font></p>" & vbNewLine)
      Response.End
   else
      Name = Trim("" & rs("M_NAME"))
      Email = Trim("" & rs("M_EMAIL"))
   end if
   rs.close
   set rs = nothing

if Request.QueryString("mode") = "DoIt" then
   Err_Msg = ""
      RandCode = Request.Form("code")
      strRCCode = Request.Form("Coder")
      RandCode2 = (strRCCode + 17456) / 50000
      lenCode = Len(RandCode2)
      NullStop = False
      If LenCode < 6 and Nullstop = False then
         For J = 1 to (6 - LenCode)
            NullRC = NullRC & "0"
         Next
         NullStop = True
      End If
      RandCode2 = NullRC & RandCode2
'         if RandCode = "" then
'      Err_Msg = Err_Msg & "<li>Please enter the authentication code.</li>"
'   end if

   if (Request.Form("YName") = "") then
      Err_Msg = Err_Msg & "<li>You must enter your name</li>"
   end if
   if (Request.Form("YEmail") = "") then
      Err_Msg = Err_Msg & "<li>You Must give your email address</li>"
   else
      if (EmailField(Request.Form("YEmail")) = 0) then
         Err_Msg = Err_Msg & "<li>You Must enter a valid email address</li>"
      end if
   end if
   If RandCode <> RandCode2 then
         Err_Msg = Err_Msg & "<li>Invalid or missing authentication code</li>"
      End If
'  if (Request.Form("Name") = "") then
'     Err_Msg = Err_Msg & "<li>You must enter the recipients name</li>"
'  end if
'  if (Request.Form("Email") = "") then
'     Err_Msg = Err_Msg & "<li>You Must enter the recipients email address</li>"
'  else
'     if (EmailField(Request.Form("Email")) = 0) then
'        Err_Msg = Err_Msg & "<li>You Must enter a valid email address for the recipient</li>"
'     end if
'  end if
   if (Request.Form("Msg") = "") then
      Err_Msg = Err_Msg & "<li>You Must enter a message</li>"
   end if
   if lcase(strEmail) = "1" then
      if (Err_Msg = "") then
         strRecipientsName = Name
         strRecipients = Email
         strSubject = strForumTitle
         strMessage = Request.Form("Msg") & vbNewline & vbNewline
         strMessage = strMessage & "You received this from : " & Request.Form("YName") & " (" & Request.Form("YEmail") & ") "
         strFromName = Request.Form("YName")
         strSender = Request.Form("YEmail")
         %>
         <!--#INCLUDE FILE="inc_mail.asp" -->
         <%
         Response.Write("<p><b><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """><center><br>Your email has been sent</center></font></b></p>" & vbNewLine)
         Response.write " <p align=""center""><font size=""" & strDefaultFontSize & """ align=""center""><a href=""JavaScript:history.go(-2)"">Go Back</a></font></p><br /><br />" & vbNewLine
      else
         Response.Write("<p><b><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """><center><br>There Was A Problem</center></font></b></p>" & vbNewLine)
         Response.Write "<table align=""center"">" & vbNewLine & _
            "<tr>" & vbNewLine & _
            "<td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
            "</tr>" & vbNewLine & _
            "</table>" & vbNewLine
         Response.Write("<p><font size=""" & strDefaultFontSize & """><center><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></center></font></p><br><br>" & vbNewLine)
      end if
   end if
else
   Response.Write "<form action=""contact.asp?mode=DoIt"" method=""post"" id=""Form1"" name=""Form1"">" & vbNewLine & _
      "  <input type=""hidden"" name=""Page"" value=""" & Request.QueryString & """>" & vbNewLine & _
      "  <br><table align=""center"" border=""0"" width=""95%"" cellspacing=""0"" cellpadding=""0"">" & vbNewLine & _
      "     <tr>" & vbNewLine & _
      "        <td bgcolor=""" & strPopUpBorderColor & """>" & vbNewLine & _
      "           <table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""4"">" & vbNewLine & _
      "              <tr>" & vbNewLine & _
      "                 <td colspan=""2"" bgColor=""" & strHeadCellColor & """ align=""center"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>Contact " & strForumTitle & "</font></b></td>" & vbNewLine & _
      "              </tr>" & vbNewLine & _
      "              <tr>" & vbNewLine & _
      "                 <td bgColor=""" & strPopUpTableColor & """ align=""right"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Your Name:</font></b></td>" & vbNewLine & _
      "                 <td bgColor=""" & strPopUpTableColor & """><input type=""text"" name=""YName"" size=""25""></td>" & vbNewLine & _
      "              </tr>" & vbNewLine & _
      "              <tr>" & vbNewLine & _
      "                 <td bgColor=""" & strPopUpTableColor & """ align=""right"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Your E-mail:</font></b></td>" & vbNewLine & _
      "                 <td bgColor=""" & strPopUpTableColor & """><input type=""text"" name=""YEmail"" size=""25""></td>" & vbNewLine & _
      "              </tr>" & vbNewLine & _


      "              <tr>" & vbNewLine & _
      "                 <td bgColor=""" & strPopUpTableColor & """ align=""right"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Enter Code:</font></b></td>" & vbNewLine & _
      "                 <td bgColor=""" & strPopUpTableColor & """>" & vbNewLine
strRCCode = Request.QueryString("rc")
strRC = Request.QueryString("code")
strRCP = Request.QueryString("p")
If strRC = "image" then
   NullStop = False
   RandCode = (strRCCode + 17456) / 50000
   lenCode = Len(RandCode)
   If LenCode < 6 and Nullstop = False then
   For J = 1 to (6 - LenCode)
      NullRC = NullRC & "0"
   Next
   NullStop = True
   End If
   RandCode = NullRC & RandCode
   ImageP = Mid(RandCode, strRCP,1)
   Response.Redirect "images/" & ImageP & ".gif"
End If

HowManyNbr=6
         NumbersToShow = ""
      Randomize
         For I = 1 to HowManyNbr
         NumbersToShow = NumbersToShow & Fix(9*Rnd)
      Next
      RandomizedCode = NumbersToShow * 50000 - 17456
      NullStop = False
      For I = 1 to HowManyNbr
         Response.Write  "    <img src='contact.asp?code=image&rc=" & RandomizedCode &"&p=" & I & "' border='0' alt='Code'>"
      Next
   Response.Write "   <input type=""hidden"" name=""Coder"" value=""" & RandomizedCode & """>" & vbNewLine & _
                  "   <input type=""text"" name=""code"" size=""" & HowManyNbr & """ maxlength=""" & HowManyNbr & """></td>" & vbNewLine & _
      "              <tr>" & vbNewLine & _
      "                 <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""top"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Message:</font></b></td>" & vbNewLine & _
      "                 <td bgColor=""" & strPopUpTableColor & """><textarea name=""Msg"" id=""msg"" cols=""50"" rows=""10""></textarea><div><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ id=""msg-status""></div></td>" & vbNewLine & _
      "              </tr>" & vbNewLine & _
      "              <tr>" & vbNewLine & _
      "                 <td bgColor=""" & strPopUpTableColor & """ colspan=""2"" align=""center""><input type=""submit"" value=""Send"" id=""Submit1"" name=""Submit1""></td>" & vbNewLine & _
      "              </tr>" & vbNewLine & _
      "           </table>" & vbNewLine & _
      "        </td>" & vbNewLine & _
      "     </tr>" & vbNewLine & _
      "  </table>" & vbNewLine & _
      "</form>" & vbNewLine & _
      "<script type=""text/javascript"">" & vbNewLine & _
      "  fieldlimiter.setup({" & vbNewLine & _
      "  thefield: document.getElementById(""msg"")," & vbNewLine & _
      "  maxlength: 500," & vbNewLine & _
      "  statusids: [""msg-status""]," & vbNewLine & _
      "  onkeypress:function(maxlength, curlength){" & vbNewLine & _
      "}" & vbNewLine & _
      "})" & vbNewLine & _
      "</script>" & vbNewLine
end if

WriteFooter
Response.End
%>


Copy this code below and name it formfieldlimiter.js and upload it to your forums directory if you want to use the character count feature.

//** Form field Limiter v2.0- (c) Dynamic Drive DHTML code library: http://www.dynamicdrive.com
//** Feb 25th, 09'- Script creation date
//** This notice must stay intact for legal use

var fieldlimiter={

defaultoutput: "<b>[int]</b> characters remaining in your input limit.", //default message that gets output to statusid element

uncheckedkeycodes: /(8)|(13)|(16)|(17)|(18)/, //keycodes that are not checked, even when limit has been reached. See http://www.javascriptkit.com/jsref/eventkeyboardmouse.shtml for avail keycodes

limitinput:function(e, config){
   var e=window.event || e
   var thefield=config.thefield
   var keyunicode=e.charCode || e.keyCode
   if (!this.uncheckedkeycodes.test(keyunicode)){
      if (thefield.value.length>=config.maxlength){
         if (e.preventDefault)
            e.preventDefault()
         return false
      }
   }
},

showlimit:function(config){
   var thefield=config.thefield
   var statusids=config.statusids
   var charsleft=config.maxlength-thefield.value.length
   if (charsleft<0) //if user has exceeded input limit (possible if cut and paste text into field)
      thefield.value=thefield.value.substring(0, config.maxlength) //trim input
   for (var i=0; i<statusids.length; i++){
      var statusdiv=document.getElementById(statusids[i])
      if (statusdiv) //if status DIV defined
         statusdiv.innerHTML=this.defaultoutput.replace("[int]", Math.max(0, charsleft))
   }
   config.onkeypress.call(thefield, config.maxlength, thefield.value.length)
},

cleanup:function(config){
   for (var prop in config){
      config[prop]=null
   }
},


addEvent:function(targetarr, functionref, tasktype){
   if (targetarr.length>0){
      var target=targetarr.shift()
      if (target.addEventListener)
         target.addEventListener(tasktype, functionref, false)
      else if (target.attachEvent)
         target.attachEvent('on'+tasktype, function(){return functionref.call(target, window.event)})
      this.addEvent(targetarr, functionref, tasktype)
   }
},

setup:function(config){
   if (config.thefield){ //if form field exists
      config.onkeypress=config.onkeypress || function(){}
      config.thefield.value=config.thefield.value
      this.showlimit(config)
      this.addEvent([window], function(e){fieldlimiter.showlimit(config)}, "load")
      this.addEvent([window], function(e){fieldlimiter.cleanup(config)}, "unload")     
      this.addEvent([config.thefield], function(e){return fieldlimiter.limitinput(e, config)}, "keypress")
      this.addEvent([config.thefield], function(){fieldlimiter.showlimit(config)}, "keyup")
   }
}

}


Then add this line in your inc_header.asp page:

Response.Write "<script type=""text/javascript"" src=""formfieldlimiter.js""></script>" & vbNewLine

It should go below the second instance of this line:

'## END   - REMOVAL, MODIFICATION OR CIRCUMVENTING THIS CODE WILL VIOLATE THE SNITZ FORUMS 2000 LICENSE AGREEMENT

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD

Edited by - leatherlips on 04 March 2009 14:26:51
Go to Top of Page

TastyNutz
Junior Member

USA
251 Posts

Posted - 04 March 2009 :  15:34:48  Show Profile  Visit TastyNutz's Homepage
You're welcome, but this still isn't perfect. I received one spam over night and one this afternoon, which were probably manual. At least I'm hoping it was manual, and not a bot which has somehow defeated this code.

After the first spam, I included a SUB to filter the message for keywords and redirect the spammer before the email sends. The second spam had none of the keywords and got through. So, I added more keywords from the email.

Both came from different IPs but the same Russian email address, which is in forum spam databases. Before I ban the address, I will wait to see if he keeps hitting me.

Anybody have ideas for evil redirects for these bottom feeders?


PowerQuad Disability Support Forum
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 04 March 2009 :  16:17:00  Show Profile  Visit leatherlips's Homepage
quote:
Originally posted by TastyNutz

After the first spam, I included a SUB to filter the message for keywords and redirect the spammer before the email sends. The second spam had none of the keywords and got through. So, I added more keywords from the email.

How did you do this?

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Previous Page | Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.31 seconds. Powered By: Snitz Forums 2000 Version 3.4.07