⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 check_admin_login.asp

📁 于毕业设计与论文以及做课题用-MSK Simulink simulation program for the design and graduation thesis topic, and makin
💻 ASP
字号:
<!--#include file="../Conn.asp"-->
<!--#include file="../inc/md5.asp"-->
<%
Dim admin,UserPassword,passcode
admin=Checkstr(trim(Request.Form("admin")))
UserPassword=MD5(Checkstr(trim(Request.Form("password"))))
IF admin="" or UserPassword="" Then
response.Write "<script LANGUAGE='javascript'>alert('登录失败!请检查您的登录名和密码!');history.go(-1);</script>"
ConnClose()
response.end
End IF

if not isnumeric(Request.Form("verifycode")) then
response.Write "<script LANGUAGE='javascript'>alert('登录失败!验证码必须是数字,请正确填写!');history.go(-1);</script>"
ConnClose()
response.end
end if

passcode=Cint(Trim(Request.Form("verifycode")))

set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from [HX33_Admin] where AdminPass='"&UserPassword&"' and AdminName='"&admin&"' " ,conn,1,1
if rs.bof and rs.eof then
response.write "<script LANGUAGE='javascript'>alert('你的用户名或者密码错误,登录失败!');history.go(-1);</script>"
rs.Close
set rs=nothing
ConnClose()
response.end
else
if passcode<>Cint(Session("verifycode")) then
response.Write "<script LANGUAGE='javascript'>alert('登录失败!验证码错误!');history.go(-1);</script>"
rs.Close
set rs=nothing
ConnClose()
response.end
end if

IF UserPassword=Rs("AdminPass") and admin=rs("AdminName") Then
session("AdminID")=trim(rs(0))
session("Admin")=trim(rs("AdminName"))
session("Rank")=int(rs("AdminRank"))
session.Timeout=20
response.Cookies("HX33")("Admin")=trim(Request.Form("admin"))
Response.Cookies("HX33").Expires = Now()+1

Login_IP = Request.ServerVariables("HTTP_X_FORWARDED_FOR") 
If Login_IP = "" Then Login_IP = Request.ServerVariables("REMOTE_ADDR") '获取登陆帐户的登陆IP地址

set Rs1= Server.CreateObject("adodb.recordset")
Slq1="select * from HX33_Admin_Detail where ID is null"
Rs1.open Slq1,conn,1,3
rs1.addnew()
rs1("AdminName")=trim(rs("AdminName"))
rs1("Login_IP")=Login_IP
rs1.update()
rs1.close
set rs1=nothing

rs.Close
set rs=nothing
ConnClose()
response.Redirect "index.asp"
Else
response.write "<script LANGUAGE='javascript'>alert('你的密码或者帐号有错,登录失败!');history.go(-1);</script>"
rs.Close
set rs=nothing
ConnClose()
End IF
End IF
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -