在线$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$为什么我乱输入也可以登入!!!!
clcy 2005-01-08 02:29:19 index.asp
一个用户输入框 login
用户密码输入框 password
数据库:clcy
表:check
字段:
name password
admin admin888 登入用户和密码
------------------------------
login.asp
代码如下:
<%@ Language=VBScript %>
<%
if isempty(request.form("login")) then
session.abandon()
session("clcy")=1
else
set conn=server.createobject("adodb.connection")
conn.open "provider=microsoft.jet.oledb.4.0;data source="&server.mappath("zz/clcy.mdb")
thename=request.form("login")
thepassword=request.form("password")
if instr(thename,"")=0 and instr(thepassword,"")=0 and instr(thename,"")=0 and instr(thepassword,"")=0 then
set rslogin=conn.execute("select * from check where "&"name='"&thename&"' and "&"password='"&thepassword&"'")
if rslogin.eof then
session("clcy")=session("clcy")+1
if application("clcy")=0 then
themessage="登录失败,请重试:"
elseif session("clcy")>application("clcy") then
themessage="登录不成功,登录次数已满,无法重试"
else
thetimes=application("clcy")-session("clcy")+1
themessage="登录不成功,还有"& thetimes &" 次机会,请重试:"
end if
end if
else
response.write"正在登陆..."
response.write"<meta http-equiv=refresh content=""3;url=index1.asp"">"
response.end
end if
end if
%>
无论我输入什么都可以登入??????????????????