智睿软件_技术交流论坛综合站长Web程序开发 → asp随机问答的验证码程序


  共有18374人关注过本帖树形打印

主题:asp随机问答的验证码程序

帅哥哟,离线,有人找我吗?
zhirui
  1楼 个性首页 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:520 积分:8740 威望:0 精华:5 注册:2009-07-07
asp随机问答的验证码程序  发帖心情 Post By:2011-02-11 16:05:30


<form action="?action=sub" method="post" name="myform">
<div>
<input name="s" type="radio" value="s1" />yingzi001.cn
<input name="s" type="radio" value="s2" />pc1w.com
<input name="s" type="radio" value="s3" />pc1w.cn
</div>
<div>
请回答:<input name="s4" type="text" value="" />
</div>
<div>
<input name="sub" type="submit" value="提交答案" />
</div>
</form>
<%
if request("action")="sub" then
%>
<%
if request("s")="s1" and request("s4")="pc1w.com" then
response.Write("回答正确")
else
response.Write("回答错误")
end if
%>
<%end if%>
<div>
说明: 当答案 选中yingzi001.cn 且 输入的答案为 pc1w.com  时 通过<br>
回答正确那,你自己加上奖励的代码就可以了。
</div>

<%
wt="你是谁|你在哪|你几岁|我的网站是"
da="小罗|深圳|22|stu.fjtjw.com"
'以上问题和答案对应
wts=split(wt,"|")
das=split(da,"|")
randomize
sn=rnd()*ubound(wts) '取出一个问题的编号,也就是数组里的位置

action=request("action")
if action="wd" then
 myda=request("myda")   '这里是接收填写的答案 暂时不用,我替换成直接的,
 snid=request("snid")
if myda<>"" then
  if cstr(myda)=cstr(das(snid)) then
   response.write "正确"
   else
  response.write "错误"
 ' response.redirect"rndwd.asp"
   end if
 else
 response.write "答案不能为空"  
 end if

end if
%>

<table width="292" height="75" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td><%response.write  wts(sn) '打印问题%> </td>
  </tr>
  <tr>
    <td><form name="form1" method="post" action="">
      <label>
        <input name="myda" type="text" id="myda"> 答案:<%=cstr(das(snid))%>
        </label>
      <label>
      <input type="submit" name="Submit" value="提交">
      </label>
      <input name="action" type="hidden" id="action" value="wd">
      <input name="snid" type="hidden" id="snid" value="<%=sn%>">
    </form>    </td>
  </tr>
</table>


网络投票评选管理系统,投票评选的合作伙伴 支持(0中立(0反对(0回到顶部