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

📄 checkstu.asp

📁 一个教育系统
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="md5.asp"-->
<%
id = trim(request("stuid"))
password = request("stupassword")

if id = "" then
 conn.close
 set conn = nothing
 response.write "<script>alert('请输入您的登录名或ID');history.go(-1);</script>"
 response.end
end if
if password = "" then
 conn.close
 set conn = nothing
 response.write "<script>alert('请输入密码');history.go(-1);</script>"
 response.end
end if



if IsNumeric(id) then
	sql = "select * from stu where stuid="&id
else
	sql = "select * from stu where loginname='"&id&"'"
end if
set rs = server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.bof and rs.eof then
 rs.close
 set rs = nothing
 conn.close
 set conn = nothing
 response.write "<script>alert('登录名或ID输入错误,没有该学生');history.go(-1);</script>"
else
 if password = rs("stupassword") then
  if rs("locked") = 1 then
   rs.close
   set rs = nothing
   conn.close
   set conn = nothing
   response.write "<script>alert('您已被禁止登陆,请与管理员联系');history.go(-1);</script>"
  else
   session("stuid") = cstr(rs("stuid"))
   rs.close
   set rs = nothing
   conn.close
   set conn = nothing
   response.redirect "dex.asp"
  end if
 else
  rs.close
  set rs = nothing
  conn.close
  set conn = nothing
  response.write "<script>alert('密码错误');window.location.href='default.asp?action=stu';</script>"
 end if
end if
%>

⌨️ 快捷键说明

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