|
|
<%
Response.Expires = 60
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
%>
<%
Function CheckCAPTCHA(valCAPTCHA)
DIM SessionCAPTCHA
SessionCAPTCHA = Trim(Session("CAPTCHA"))
Session("CAPTCHA") = vbNullString
if Len(SessionCAPTCHA) < 1 then
CheckCAPTCHA = False
exit function
end if
if CStr(SessionCAPTCHA) = CStr(valCAPTCHA) then
CheckCAPTCHA = True
else
CheckCAPTCHA = False
end if
End Function
%>
<form id="f_example" name="f_example" method="post" action="ASP_Captcha.asp">
<table width="392" height="187" border="1" align="center">
<tr>
<td colspan="2" align="center"><h2>Distort=True, DistortEx=True,
Noise=True</h2></td>
</tr>
<tr>
<td width="152" height="32">CAPTCHA Image</td>
<td width="224"><img src="aspcaptcha.asp" alt="This Is CAPTCHA
Image" width="86" height="21" /></td>
</tr>
<%
DIM strCAPTCHA
if Request.ServerVariables("REQUEST_METHOD") = "POST" then
strCAPTCHA = Trim(Request.Form("strCAPTCHA"))
if CheckCAPTCHA(strCAPTCHA & Session.SessionID) = true then
%>
<tr>
<td height="37" colspan="2" align="center"><b
style="color:#00CC00">Verified (<%=strCAPTCHA%>)</b></td>
</tr>
<%
else
%>
<tr>
<td height="37" colspan="2" align="center"><b
style="color:#FF0000">Not Verified.<br />Please Retry.</b></td>
</tr>
<%
end if
end if
%>
<tr>
<td height="66">Enter the characters in the image above</td>
<td><input name="strCAPTCHA" type="text" id="strCAPTCHA"
maxlength="8" />
</td>
</tr>
<tr>
<td height="37" colspan="2" align="center"><input type="submit"
name="Submit" value="Test Input" /></td>
</tr>
<tr>
<td height="37" colspan="2" align="center">
<a class="nav" href="http://www.tipstricks.org">Download CAPTCHA</a></td>
</tr>
</table>
</form>
|
|
|
 |