function.asp

来自「培训学员管理系统」· ASP 代码 · 共 38 行

ASP
38
字号
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn_fj16.asp" -->
<%
login=trim(request("login"))
pwd=trim(request("pwd"))


 if login="" then 
	  response.Write "<script language=javascript>{window.alert('报错:“用户名”不能为空!');window.history.go(-1);}</script>"
	  response.end
end if
 if pwd="" then 
	  response.Write "<script language=javascript>{window.alert('报错:密码不能为空!');window.history.go(-1);}</script>"
	  response.end
end if
sql="select * from admin156 where yonghuming='"&login&"' and pwd ='"&pwd&"'"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,2

if  rs.eof then
response.Write "<script language=javascript>{window.alert('对不起,您输入的用户名或密码错误,请核实后重新登录!   ');window.location.href='index.asp';}</script>"
response.end
end if
if not rs.eof then
session("ID")=rs("ID")
session("yonghuming")=rs("yonghuming")
session("xingming")=rs("xingming")
session("jibie")=rs("jibie")
session("logintimes")=rs("logintimes")+1
session("lastlogintime")=rs("lastlogintime")
rs("logintimes")=rs("logintimes")+1
rs("lastlogintime")=now
rs.update
 Response.Redirect "admin_main.asp"
end if

%>

⌨️ 快捷键说明

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