📄 logonpro.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../conn.asp"-->
<html>
<head>
<title>验证密码</title>
</head>
<body>
<%
'取得用户名和密码
username = Request.Form("name")
passwd = Request.Form("passwd")
if(isempty(username)) or (len(username)=0) then
Response.Redirect "../index1.asp"
end if
sql="select * from tbl_user where username='" & username & "'"
Dim RS
Set RS=Server.CreateObject("ADODB.RecordSet")
RS.Open sql,conn,1,3
if rs.EOF or rs.BOF then
response.write"用户名不存在!<br><br><a href=../index1.asp>点此返回重新登录</a>"
rs.Close
set rs=nothing
conn.Close
set conn=nothing
elseif passwd<>rs("passwd") then
response.write"错误的用户名或密码!<br><br><a href=../index1.asp>点此返回重新登录</a>"
rs.Close
set rs=nothing
conn.Close
set conn=nothing
else
'如果用户名和密码正确,则用户登录成功,在session中存储用户的身份验证'
'其中session("username")为用户名,session("usertype")为用户级别'
session("id")=rs("id")
session("username")=rs("username")
session("usertype")=rs("usertype")
rs.Close
set rs=nothing
'sql="update visit set visitnum=visitnum+1"
'conn.Execute sql
conn.Close
set conn=nothing
Response.Write("Success!")
'如果登录成功,检测权限,页面重定向'
Response.Redirect"common.asp"
end if
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -