ASP网页登陆密码及用户名检测(VB+ACCESS)
1.建立一个acces s数据库保存打开“使用表设计器创建表”详细如下
字段名称 数据类型id 自动编号username 文本passwo rd 文本
2. login.asp文件内容如下
<html>
<head>
<title>系统管理员登陆</title>
<meta http-eq uiv="Conte nt-Type" co nte nt="text/htm l ; cha rset=gb2312"><script Language="javaScript">function login_val idate()
{if (document.myform.username.value=="")
{alert("Error:请输入帐号 ");document.myform.username.focus();return false ;
}if (document.myform.password.value=="")
{alert("Error:请输入密码 ");docume nt.myform.password.focus();return false ;
}return true;
}
</script>
<style type="text/css">
<!--
b o d y,td {font-size: 12px;
}
-->
</style>
</head>
<body>
<p> </p>
<form action="checkmima.asp"method="post" NAME="myform" id="myform" onSubmit="returnlogin_val idate();">
<table width="250" border="0" al ign="center" cel lpadding="5" cel lspacing"style="border:1 px#cccccc sol id;">
<tr>
<td height=30 bgcolor="#eeeeee" al ign=center>∷管理员登陆∷</td>
</tr>
<tr>
<td al ign="center">用户名: <input name="Username" tabindex="1" typ e="text"id="username"></td>
</tr>
<tr>
<td al ign="center">密码: <input name="Password" tabindex="2" type="p asswo rd"i d="p a sswo rd"></td>
</tr>
<tr>
<td al ign="center"><input type="submit" name="Submit" value="登
陆"ta b i nd e x="3">
<input type="reset" name="Submit2" value="重置" tabindex="4"></td>
</tr>
</tab le>
</form>
</body>
</htm l>
3. checkmima.asp文件内容如下
<%db="数据库路径/数据库名称.mdb"
Set conn = Server.CreateObject("ADODB.Connection")connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath(""&db&"")
'connstr="DBQ="+server.mappath(""&db&"")+";DefaultDir=;DRIVER={Microsoft Access Driver(*.mdb)};"conn.Open connstr
%>
<%dim sqldim rsdim usernamedim passwordusername=replace(trim(request("username")),"'","")password=rep lace(tri m(Req uest("password")),"'","")sql="select username,password,flag from zhuce where password='"&password&"' andusername='"&username&"'"set rs = conn.execute(sql)if not(rs.bof and rs.eof) thenif password=rs(1) then
session("admin")=rs(0)session("flag")=rs(2)
Response.Redirect "Default.asp" //登陆成功后要跳转到的页面elsecal l Errorend ifelsecal l Error()end ifsub Error()
Response.Write "<script language=javascript>"
Response.Write "alert(""登陆失败!帐号或密码错误 "");"
Response.Write "histo ry.back(-1);"
Response.Write "</script>"end subrs.closeconn.closeset rs=nothingset conn=nothing
%>
很久没有分享PhotonVPS的消息,最近看到商家VPS主机套餐有一些更新所以分享下。这是一家成立于2008年的国外VPS服务商,Psychz机房旗下的站点,主要提供VPS和独立服务器等,数据中心包括美国洛杉矶、达拉斯、芝加哥、阿什本等。目前,商家针对Cloud VPS提供8折优惠码,优惠后最低2G内存套餐每月4美元起。下面列出几款主机配置信息。CPU:1core内存:2GB硬盘:30GB NVm...
2022年春节假期陆续结束,根据惯例在春节之后各大云服务商会继续开始一年的促销活动。今年二月中旬会开启新春采购季的活动,我们已经看到腾讯云商家在春节期间已经有预告活动。当时已经看到有抢先优惠促销活动,目前我们企业和个人可以领取腾讯云代金券满减活动,以及企业用户可以领取域名优惠低至.COM域名1元。 直达链接 - 腾讯云新春采购活动抢先看活动时间:2022年1月20日至2022年2月15日我们可以在...
RAKsmart 商家从原本只有专注于独立服务器后看到产品线比较单薄,后来陆续有增加站群服务器、高防服务器、VPS主机,以及现在也有在新增云服务器、裸机云服务器等等。机房也有增加到拥有洛杉矶、圣何塞、日本、韩国、中国香港等多个机房。在年前也有介绍到RAKsmart商家有提供年付129元的云服务器套餐,年后我们看到居然再次刷新年付云服务器低价格。我们看到云服务器低至年79元,如果有需要便宜云服务器的...