'======***表单提交后:***====== if Request.ServerVariables("REQUEST_METHOD")="POST" then Dim founderr,callform,msg founderr = false '是否有错误发生 callform = false '是否调用表单 msg = "" '提示信息
'==============验证码验证开始=========== dim sessionCode sessionCode = session("chkCode") session("chkCode") = "" CheckCode = trim(Request.Form("chkcode")) if CheckCode = "" then msg = msg + "<li>请填写验证码" founderr = true callform = true elseif cstr(CheckCode) <> cstr(sessionCode) then msg = msg + "<li>验证码不正确" founderr = true callform = true end if '==================验证码验证结束============
if founderr = true then call message("500") if callform = true then call myform() else msg = "<li>操作成功!" call message("500") end if '======***页面初始化(表单提交前)***====== else CheckCode = "" call myform() end if
Response.Write "</body></html>"
REM 子过程,定义表单 Sub myform() Response.Write "<table width=500 border=1 cellspacing=0 cellpadding=5 align=center>"&_ "<form name=form1 method=post action=post.asp>"&_ "<tr height=30><td rowspan=2 width=100 align=center>验证码</td>"&_ "<td><input type=text name=chkcode size=10> "&_
上一篇:一个判断session是否过期的小技巧
下一篇:Session 详解
|