·´Èº·¢ÉèÖÃ
1.½øÈëºǫ́£¬·ç¸ñ½çÃæÄ£°å×ܹÜÀí£¬page_login,template.html(13)
<TR>
<TD class=tablebody1><B>ÃÜÂëÎÊÌâ</B>£º<BR>Íü¼ÇÃÜÂëµÄÌáʾÎÊÌâ</TD>
ÔÚ´ËÁ½¾äÉÏÃæÌí¼ÓÈçÏ´úÂë
<TR>
<TD class=tablebody1>
<div style="color:red"><b>·´ÂÛ̳Ⱥ·¢±ØÌîÏî:</b></div>
<div>ΪÁË·ÀֹȺ·¢Èí¼þµÄ¶ñÒâ×¢²á£¬</div>
<div>Çë»Ø´ðÒÔÏÂÎÊÌâ</div>
<div style="color:blue;font-size=18px"><b>{$EvilQuesion}<b></div></TD>
<TD class=tablebody1><INPUT size=30 name=evilanswer> </TD>
</TR>
2. ´ò¿ªreg.asp£¬ÕÒµ½
<!--#include file="inc/md5.asp"-->
ÔÚÆäÏÂÌí¼Ó
<!--#include file="inc/CheckEvil.asp"-->
ÕÒµ½
TempLateStr=Replace(TempLateStr,"{$user_belief}",Selectinfo(5))
ÔÚÆäÏÂÌí¼Ó
Randomize
Session("EvilID")=int(Rnd*QuesionNum)
TempLateStr=Replace(TempLateStr,"{$EvilQuesion}", QuesionArray(Session("EvilID")))
ÕÒµ½
Else
quesion=Request.form("quesion")
End If
ÔÚÆäÏÂÌí¼Ó
If Request.Form("EvilAnswer")="" Then
ErrCodes=ErrCodes+"<li>"+"ÇëÌîд·À¶ñÒâ×¢²áÎÊÌâ!"
End If
If Not CheckEvil(Request.Form("EvilAnswer")) Then
ErrCodes=ErrCodes+"<li>"+ "·À¶ñÒâ×¢²áÎÊÌâ»Ø´ð´íÎó£¬Çë·µ»ØÖØÊÔ¡£"
End If
3. Ôö¼ÓÒ»¸öÐÂÎļþCheckEvil.asp£¬ÌîдÈçÏ´úÂ룬²¢ÉÏ´«µ½ÂÛ̳incĿ¼Ï£¬¼´ /inc/CheckEvil.asp¡£
<%
Dim QuesionArray(100)
Dim AnswerArray(100)
Dim QuesionNum
QuesionNum=5 'ÇëÔÚÕâÀïÕýÈ·ÉèÖÃÎÊÌâµÄ×ÜÊý
Function CheckEvil(Answer)
Dim TrueAnswer
If Session("EvilID")="" Then
CheckEvil=False
Exit Function
End If
TrueAnswer=CStr(AnswerArray(Session("EvilID")))
If Answer=TrueAnswer Then
CheckEvil=true
End If
End Function
QuesionArray(0)="10+1µÈÓÚ¶àÉÙ£¿£¨Ìáʾ£º11£©"
AnswerArray(0)="11"
QuesionArray(1)="ÎÒÃǵÄÍøÖ·ÊÇʲô£¿£¨Ìáʾ£ºwww.hulusi.com£©"
AnswerArray(1)="www.hulusi.com"
QuesionArray(2)="¡°ÄãÀ´ÕâÊÇѧϰʲôÀÖÆ÷£¿£¨Ìáʾ£ººù«˿£©"
AnswerArray(2)="ºù«˿"
QuesionArray(3)="¡°12+2µÈÓÚ¶àÉÙ£¨Ìáʾ£º14£©"
AnswerArray(3)="14"
QuesionArray(4)="×¢²áºó£¬ÄãÔ¸Òâ²ÎÓëÌÖÂÛÂ𣿣¨Ìáʾ£ºÔ¸Ò⣩"
AnswerArray(4)="Ô¸Òâ"
%>