我是菜鸟,想给网站的会员每天第一次登陆的时候加2分积分,同时把会员最后一次登陆的时间写入access数据库里,不知道该怎样实现,下面是会员登陆验证的代码,希望高手们帮个忙!小弟感激不尽!
<%
If request("act")="login" Then
username = request.Form("username")
password = md5(Request("password"))
code = request.Form("code")
If username = "" Then
response.Write("<script language=javascript>alert('用户名不能为空!');window.location.href='users_login.asp'</script>")
response.End
End If
If password = "" Then
response.Write("<script language=javascript>alert('密码不能为空!');window.location.href='users_login.asp'</script>")
response.End
End If
If code = "" Then
response.Write("<script language=javascript>alert('验证码不能为空!');window.location.href='users_login.asp'</script>")
response.End
End If
If code<>Session("getcode") then
response.Write("<script language=javascript>alert('验证码错误!');window.location.href='users_login.asp'</script>")
response.End
End If
sql = "select * from users where username='"&username&"' and password='"&password&"'"
Set rs = conn.Execute(sql)
If rs.EOF Or rs.bof Then
response.Write "<script language=javascript>"
response.Write "alert('帐号或者密码错误,请重新输入!');"
response.Write "javascript:window.location.href='users_login.asp';"
response.Write "</script>"
Else
session("username") = username
session.Timeout = 600
response.redirect "users.asp"
End If
End if
%>