ASP用户登录代码
2年前 (2024-04-22)
asp+access用户登录代码,其中
huiyuan.mdb数据库名
pUser213 表名
y_username用户名字段,y_password密码字段.
login.htm页面
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>登录</title>
</head>
<body>
<p> </p>
<form name="form1" method="post" action="loginnew.asp">
<table width="200" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2"><div align="center">登录</div></td>
</tr>
<tr>
<td width="57"><div align="center">用户名</div></td>
<td width="137" valign="top"><input name="username" type="text"
id="username" size="25"></td>
</tr>
<tr>
<td><div align="center">密码</div></td>
<td valign="top"><input name="password" type="password"
id="password" size="25"></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input type="submit" name="Submit" value="提交">
</div></td>
</tr>
</table>
</form>
</body>
</html>
loginnew.asp网页
<%
dim username,password
username=request.form("username")
password=request.form("password")
set rs=server.createobject("adodb.recordset")
conn = "DBQ=" + server.mappath("huiyuan.mdb") + ";DefaultDir=;
DRIVER={Microsoft Access Driver (*.mdb)};"
sql="select * from pUser213 where y_username='"&username&"'"
rs.open sql,conn,1,1
if rs.eof then
response.write "<script>alert('登录失败');history.back();</script>"
response.end
else
if rs("y_password")<>password then
response.write "<script>alert('登录失败');history.back();</script>"
response.end
end if
session("admin")=username
response.write"<script>alert('登录成功');location.href='index.asp'</script>"
end if
%>
huiyuan.mdb数据库名
pUser213 表名
y_username用户名字段,y_password密码字段.
login.htm页面
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>登录</title>
</head>
<body>
<p> </p>
<form name="form1" method="post" action="loginnew.asp">
<table width="200" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2"><div align="center">登录</div></td>
</tr>
<tr>
<td width="57"><div align="center">用户名</div></td>
<td width="137" valign="top"><input name="username" type="text"
id="username" size="25"></td>
</tr>
<tr>
<td><div align="center">密码</div></td>
<td valign="top"><input name="password" type="password"
id="password" size="25"></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input type="submit" name="Submit" value="提交">
</div></td>
</tr>
</table>
</form>
</body>
</html>
loginnew.asp网页
<%
dim username,password
username=request.form("username")
password=request.form("password")
set rs=server.createobject("adodb.recordset")
conn = "DBQ=" + server.mappath("huiyuan.mdb") + ";DefaultDir=;
DRIVER={Microsoft Access Driver (*.mdb)};"
sql="select * from pUser213 where y_username='"&username&"'"
rs.open sql,conn,1,1
if rs.eof then
response.write "<script>alert('登录失败');history.back();</script>"
response.end
else
if rs("y_password")<>password then
response.write "<script>alert('登录失败');history.back();</script>"
response.end
end if
session("admin")=username
response.write"<script>alert('登录成功');location.href='index.asp'</script>"
end if
%>
- 随机文章
- 核心危机(核心危机魔石合成攻略)
- 风儿(风儿轻轻的吹)
- 饿了么红包怎么用(饿了么红包怎么用微信支付)
- 儿童教育文章(儿童教育)
- 光遇花手先祖位置(安卓光遇手花先祖)
- 广州4a广告公司(广州4a广告公司创意总监年薪)
- 抖音卡(抖音卡顿怎么解决)
- 陈武简历
- 帆船比赛(帆船比赛视频)
- 海猫鸣泣之时游戏(海猫鸣泣之时游戏在哪玩)
- 韩国媳妇和小雪(韩国媳妇和小雪的父亲工资是多少)
- 儋州市第二中学(儋州市第二中学录取分数线)
- 鬼泣5攻略(鬼泣5攻略第三关怎么跳)
- 地球日主题(2020年世界地球日主题)
- 和柳亚子(和柳亚子先生于田)
- 冰客(冰客果汁)
- 充值卡代理(充值卡代理加盟)
- 拆奶罩
- 郭妮小说(恶魔的法则郭妮小说)
- 东天目山(东天目山景区)
- 杭同(杭同培训中心怎么样)
- 蝙蝠给人类的一封信(蝙蝠给人类的一封信)
- 疯狂填字(疯狂填字5)
- 点对点短信息(点对点短信息费是什么意思)
- 河北省大运会(河北省大运会时间)
- 骇客神条(骇客神条怎么辨别真假)
- 查传倜(查传倜个人生活)
- 广州晓港公园(广州晓港公园正门图片)
- 钢筋等级符号(钢筋等级符号电脑怎么输入)
- 常州天宁寺(常州天宁寺求什么灵验)
