Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Captcha into ASP mail form script

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
Zenfor Posted - 02 April 2013 : 10:28:17
Hi,

I have a standard asp mail form script I have been using with a randomized number check yet I still get a lot of spam and nuisance emails. Does anyone know of a ready made script or where I can get a captcha routine that I can insert into my existing script? or does anyone have any ideas on how I can eliminate emails completed by bots?

Thanks!
4   L A T E S T    R E P L I E S    (Newest First)
Webbo Posted - 03 April 2013 : 17:45:17
quote:
Originally posted by Carefree

Webbo, Zenfor wants "non-forum related" advice. CAPTCHA routines made to integrate into Snitz aren't the ideal solution......




Whoops, I never saw the forum title, just the post - my eyes bad lol
Zenfor Posted - 03 April 2013 : 15:28:34
Thanks for the replies. I'm glad I posted this here because it got me thinking, as a result, I think I solved it. I think they were bypassing the entry form and going right into the "processing of the form script". I put a check at the beginning of that now to verify the form random number. I won't know for sure unless I don't see them come in - my fingers are crossed... Thanks!
Carefree Posted - 03 April 2013 : 07:34:06
Webbo, Zenfor wants "non-forum related" advice. CAPTCHA routines made to integrate into Snitz aren't the ideal solution.

That said, there are pros and cons for using CAPTCHA at all. Some advise NEVER to use them; but spam-bots will bury you if you don't. I cannot recommend any particular anti-spam routine from the information provided.

You could do something like this, you would have to edit the database path and put images titled "a"-"z" and "0"-"9" into an images folder. The database would require a table titled "CAPTCHA" with two fields (DTG) and (Captured), both of which set to varchar(16).

This method would write the CAPTCHA into the database set to the exact second of its creation (to preclude duplicates). When the user submits the form for validation, the CAPTCHA is deleted from the table.

"inc_captcha.asp"


<!DOCTYPE HTML>
<%
On Error Resume Next
strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("database.mdb")         				'	##	MS Access 2000 using virtual path
set my_Conn = Server.CreateObject("ADODB.Connection")
my_Conn.Errors.Clear
Err.Clear
my_Conn.Open strConnString

Function doublenum(fNum)
	If fNum > 9 Then
		doublenum = fNum
	Else
		doublenum = "0" & fNum
	End If
End Function

If Request.Form("DTG") > "" Then
	strSql="SELECT * FROM CAPTCHA WHERE DTG='" & Request.Form("DTG") & "' AND CAPTURED='" & Request.Form("Captured") & "'"
	Set rsCheck=my_Conn.Execute(strSql)
	If not rsCheck.EOF Then
		'	CAPTCHA Matches, continue
		rsCheck.Close
		my_Conn.Execute("DELETE * FROM CAPTCHA WHERE DTG='" & Request.Form("DTG") & "' AND CAPTURED='" & Request.Form("Captured") & "'")
		Response.Write	"Correct ..."
		Response.End
	Else
		'	CAPTCHA Fails, do something here
		Response.Write	"CAPTCHA Failed<br /><br />"
		my_Conn.Execute("DELETE * FROM CAPTCHA WHERE DTG='" & Request.Form("DTG") & "'")
	End If
	Set rsCheck = Nothing
End If
strCap="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
intI=62
strCaptured=""
strCapture=""
Randomize
a=int(rnd*5)+3
For i = 1 to a
	Randomize
	j=int(rnd*intI)+1
	strA=uCase(mid(strCap,j,1))
	Response.Write	"<img src=""images/" & strA & ".png"" height=""24"" width=""24"">"
	strCapture=strCapture & cStr(j)
	strCaptured=strCaptured&strA
Next
Response.Write	"       "
strCaptured=strCaptured&" "
Randomize
a=int(rnd*5)+3
For i = 1 to a
	Randomize
	j=int(rnd*intI)+1
	strA=uCase(mid(strCap,j,1))
	Response.Write	"<img src=""images/" & strA & ".png"" height=""24"" width=""24"">"
	strCapture=strCapture & cStr(j)
	strCaptured=strCaptured&strA
Next
strDateNow = Year(Now())&DoubleNum(Month(Now()))&DoubleNum(Day(Now()))
strTimeNow = DoubleNum(Hour(Now()))&DoubleNum(Minute(Now()))&DoubleNum(Second(Now()))
strNow = strDateNow & strTimeNow
strSql="INSERT INTO CAPTCHA (DTG,CAPTURED) VALUES ('" & strNow & "', '" & strCaptured & "')"
my_Conn.Execute(strSql)

Response.Write	"<form action=""inc_captcha.asp"" method=""post"">" & vbNewLine & _
	"	<input type=""hidden"" name=""DTG"" value=""" & strNow & """>" & vbNewLine & _
	"	Enter the two images below:<br /><input type=""text"" name=""Captured"" size=""30"" maxlength=""17"" value="""">" & vbNewLine & _
	"	<input type=""submit"" name=""submit"">" & vbNewLine & _
	"</form>" & vbNewLine
%>
Webbo Posted - 02 April 2013 : 16:21:02
Here you are: http://www.snitzbitz.com/mods/details.asp?Version=All&mid=230


Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000 Version 3.4.07