[求助] 限制重复登录的问题??
我作的考勤登录系统,意图是用 recordYear, recordMonth, recordDay,Iswork限制一天用户不能重复登录。但结果总是达不到要求。我也加了判断Iswork是否等于1的判断语句,但不能用。垦求各位前辈多帮助。指出问题哪里??<%
if Request.Form("action")="true" then
username=trim(Request.Form("username")) '登录用户名
password=trim(Request.Form("password")) '登录密码
otherpwd = Trim(Request.form("otherpwd")) '附加码
reotherpwd = Trim(Request.form("reotherpwd"))'生成的附加码
legalTag=checkenter()
If legalTag=TRUE then '如果没有非法输入,则进行用户验证
if otherpwd = reotherpwd then '附加码比较
legalUserTag=checksysUser() '系统用户验证
if legalUserTag=true then
If Session("level")=1 and Session("admin")="True" Then
Response.Redirect("manage.asp")
Response.End
End If
If Session("level")=2 Then
Response.Redirect("main.asp")
Response.End
End If
If Session("level")=3 Then
set rs=server.createobject("adodb.recordset")
Sql="SELECT * FROM kaoqing_table WHERE user='"&username&"' and recordYear="&Year(Now())&" and recordMonth="&Month(Now())&" and recordDay="&Day(Now())&"" '提取表中本年本月本日的Iswork值。
If Iswork=0 Then '如果Iswork=0,则登录并记录登录年月日及时间
insertsql="select * from kaoqing_table"
rs.open insertsql,db,1,3
rs.addnew
rs("user")=username
rs("recordYear")=Year(Now())
rs("recordMonth")=Month(Now())
rs("recordDay")=Day(Now())
rs("recordTime")=Time
rs("Iswork")=1
rs("note")=note
rs.update
rs.close
set rs=nothing
Response.Redirect("normal.asp")
Response.End
else '否则说明你已登录过了
Response.write "你已登录过了"
End If
End If
else
errmsg="<font color=#FF0000><b>用户名或者用户密码错误,请重新输入!</b></font>"
end if
else
errmsg="<font color=#FF0000><b>附加码输入错误,请重新输入!</b></font>"
end if
else
errmsg="<font color=#FF0000><b>用户名输入有误,请重新输入!</b></font>"
end if
end if
%>