📄 checklogin.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="tcconn.asp" -->
<html>
<head>
<title>Management System</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="title" content="Management System" />
</head>
<%
dim username ,password
username=trim(Request.Form("username"))
password=trim(Request.Form("password"))
username = Replace(username, "'", "")
password = Replace(password,"'", "")
if username="" or password="" then
response.write "<script language=JavaScript>{window.alert('用户和密码不能为空!');window.location.href='index.asp';}</script>"
response.end
end if
Dim sql,Rs
sql = "select top 1 * from [dbo_manager] where [name] = '" & username & "'and [password]='" & password & "'"
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.Open sql,conn,1,1
If Rs.Recordcount=0 Then
response.write "<script language=JavaScript>{window.alert('用户和密码错误!');window.location.href='index.asp';}</script>"
Response.End()
End If
session("userid") = Rs("id")
session("username") = Rs("name")
session("password") = Rs("password")
session("admin_logged_in")=true
session("img1")=""
session("img")=""
Response.Redirect "layout.asp"
rs.close
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -