asp用户登陆验证代码怎么写

来源:百度知道 编辑:UC知道 时间:2024/05/29 08:50:11
我希望给我的是代码,数据库用的是access

登陆验证代码 如下

<!--#include file="Connections/connlogin.asp"-->
<% if request.Form("user")="" then
response.Write"<script language=javascript>alert('请输入用户名');history.back(-1);</script>"
response.End()
end if
if request.Form("pwd")="" then
response.Write"<script language=javascript>alert('请输入密码');history.back(-1);</script>"
response.End()
end if
user=trim(request.Form("user"))
pwd=trim(request.Form("pwd"))
sql="select * from login where user='"&user&"' and pwd='"&pwd&"'"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,cn,1,1
if rs.eof then
response.Write"<script> alert('无此用户');history.back(-1);</script>"
response.End()
else
s