当前位置:编程学习 > asp >>

asp用户登录程序

<%
dim sql
dim rs
dim username
dim password
username=replace(trim(request.form("username")),"'","")
password=replace(trim(request.form("password")),"'","")
password=md5(password)
set rs=server.createobject("adodb.recordset")
sql="select * from [User] where LockUser=False and username='" & username & "' and password='" & password &"'"
rs.open sql,conn,1,1
if not(rs.bof and rs.eof) then
 if password=rs("password") then
  session("UserName")=rs("username")
  'session("purview")=999
  Response.Redirect "ment1.asp"
 end if
end if
rs.close
conn.close
set rs=nothing
set conn=nothing
%>
<html>
<head>
<style type="text/css">
A:link,A:active,A:visited{TEXT-DECORATION:none ;Color:#000000}
A:hover{Color:#4455aa}
BODY{
FONT-SIZE: 12px;
COLOR: #000000;
FONT-FAMILY:  宋体;
background-color: #999999;
scrollbar-face-color: #C0C0C0;
scrollbar-highlight-color: #C0C0C0;
scrollbar-shadow-color: #C0C0C0;
scrollbar-3dlight-color: #E0E0E0;
scrollbar-arrow-color:  #000000;
scrollbar-track-color: #E0E0E0;
scrollbar-darkshadow-color: #C0C0C0;
}
TD{
font-family: 宋体;
font-size: 12px;
line-height: 15px;
}
td.TableBody1
{
background-color: #137171;
}
.tableBorder1
{
width:97%;
border: 1px;
background-color: #0D4F4F;
}
.table { border-collapse: collapse; border-left: 1px solid #000000; border-right: 1px solid #000000; background-color:#ffffff }
INPUT{BORDER-TOP-WIDTH: 1px; PADDING-RIGHT: 1px; PADDING-LEFT: 1px; BORDER-LEFT-WIDTH: 1px; FONT-SIZE: 9pt; BORDER-LEFT-COLOR: #cccccc; BORDER-BOTTOM-WIDTH: 1px; BORDER-BOTTOM-COLOR: #cccccc; PADDING-BOTTOM: 1px; BORDER-TOP-COLOR: #cccccc; PADDING-TOP: 1px; HEIGHT: 18px; BORDER-RIGHT-WIDTH: 1px; BORDER-RIGHT-COLOR: #cccccc}
</style>
</head>
<body>
<br><br><br>
<table align='center' width='300' border='0' cellpadding='4' cellspacing='0' class='border'>
 <tr >
  
    <td height='15' colspan='2' align="center" class='title'>操作: 确认身份失败!</td>
</tr>
<tr>
    <td height='23' colspan='2' align="center" class='tdbg'> <br>
      <br>
      用户名或密码错误!!!<br>
      <br> <a href='javascript:onclick=history.go(-1)'>【返回】</a> <br>
      <br></td>
</tr></table></body></html>

补充:asp教程,ASP入门
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,