ASP用户登录验证代码
发布时间:2008-05-15 12:49:00
标签:验证,登录,asp
asp+access用户登录代码,loginnew.asp网面包含了登录框及验证用户的代码
an.mdb数据库名
fd表名
y_username用户名字段,y_password密码字段.
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
%>
再来看html 代码.
login.htm页面
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>登录 - asp之家</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>
0
投稿
猜你喜欢
- 本文主要讨论了python中getpass模块的相关内容,具体如下。getpass模块昨天跟学弟吹牛b安利Python标准库官方文档的时候偶
- 由于最近有个任务需要在python环境下跑,项目是python3.6 + tensorflow1.3.1.现总结安装环境:卸载Python3
- 那么,现在如果给出一个权限编号,要去检索出用后这个权限的用户集合,就会需要在逗号分隔的多个权限编号中去匹配给出的这个权限编号。如果使用lik
- 什么是Firebug从事了数年的Web开发工作,越来越觉得现在对WEB开发有了更高的要求。要写出漂亮的HTML代码;要编写精致的CSS样式表
- 这里我们将对Python 3.1核心语言的变化进行分析,包括字符串的格式化、说明符以及其他方面的内容。希望这些变化能对大家了解Python
- 本文实例讲述了Python自定义装饰器原理与用法。分享给大家供大家参考,具体如下:什么是装饰器?装饰器本质是一个函数,它可以在不改变原来的函
- 2020年11月22日最新分享pycharm激活码,这次分享的pycharm激活码适用pycharm2020最新版及pycharm2019、
- 如何验证IP地址?sub chkIP(boardid) dim rsIP dim ipAr
- 定义一个什么都不做的函数>>> def a():... pass...>>> def printHell
- 前言本文主要给大家介绍了关于linux/mac安装mysql忘记密码的相关解决办法,分享出来供大家参考借鉴,下面话不多说了,来一起看看详细的
- 以行的形式读出一个文件最简单的方式是使用文件对象的readline()、readlines()和xreadlines()方法。Python2
- 本文实例讲述了Python计算回文数的方法。分享给大家供大家参考。具体如下:这里检查数字是不是回文数,用196算法生成一个数字的回文数num
- Nagios是一款开源的免费网络监视工具,能有效监控Windows、Linux和Unix的主机状态,交换机路由器等网络设置,打印机等。在系统
- 一、概述dba在工作中避不开的两个问题,sql使用绑定变量到底会有多少的性能提升?数据库的审计功能如果打开对数据库的性能会产生多大的影响?最
- Python提供了多个内置模块用于操作日期时间,像calendar,time,datetime。time模块我在之前的文章已经有所介绍,它提
- 简介有兴趣可以看看: 解释性语言+动态类型语言+强类型语言交互模式:(主要拿来试验,可以试试 ipython)$python>>
- 前言文件上传漏洞大多出现在可以进行文件上传的地方,如用户头像上传,文档上传处等。该漏洞是一个危害十分大的漏洞,通过文件上传,攻击者可以上传w
- 前言前段时间因为需要处理一大堆验收单,都是一些简单的复制粘贴替换工作,于是就想到用python进行处理。接下来进入正题~实现需求我是用的开发
- 本文实例讲述了JS实现向表格行添加新单元格的方法。分享给大家供大家参考。具体如下:下面的JS代码可以想表格中指定id的行插入新的单元格<
- 当我们导入的模型含有自定义层或者自定义函数时,需要使用custom_objects来指定目标层或目标函数。例如:我的一个模型含有自定义层“S