发布网友 发布时间:2025-01-02 14:51
共1个回答
热心网友 时间:9分钟前
<!--#include file="Conn.asp"-->
<!--#include file="checkcode.asp"-->
<%
admin=request.Form("username")
password=Request("userpass")
VerifyCode=request.form("txt_check")
lei=request.Form("leixing")
if VerifyCode="" then
response.Write("<script>alert('验证码不能为空!');;history.go(-1)'</script>")
response.end
end if
if cstr(Session("validateCode"))<>cstr(Request.Form("VerifyCode")) then
response.Write("<script>alert('验证码错误!');;history.go(-1)'</script>")
response.End
end if
if lei="student" then
sql="select * from user where admin='"&userid&"' and password='"&userpass&"'"
set rs=conn.execute(sql)
if rs.eof or rs.bof then
response.Write("<script>alert('帐号密码错误!';history.go(-1))</script>")
response.End
else
response.redirect "hello.html"
response.End
end if
else
sql="select * from admin where admin='"&adminid&"' and password='"&adminpass&"'"
set rs=conn.execute(sql)
if rs.eof or rs.bof then
response.Write("<script>alert('帐号密码错误!';history.go(-1))</script>")
response.End
else
response.redirect "hello.html"
end if
response.End
%>
数据是非数字用内置函数就可以做到:
if Not IsNumeric(A) then
非数字即执行代码!
end if
if Not IsNumeric(B) then
end if