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

📄 receivedata.asp

📁 eayanQuery思燕大学成绩查询系统 版本 V1.6
💻 ASP
字号:
<%option explicit%>
<!--#include file="Conn.asp"-->
<!--#include file="include/PublicFunction.asp"-->
<!--#include file="include/ReplaceHtml.asp"-->
<!--#include file="include/md5.asp"-->
<% call CheckOuterUrl() %>  
 <%
 DIM UserType,Username,Password,UserRs,UserSql
   UserName=HtmlEnCode(request.Form("Username"))
   Password=HtmlEncode(request.Form("Password"))
   UserType=HtmlEncode(request.Form("UserType"))
   Set UserRs=server.CreateObject("adodb.recordset")
If UserType="教师" then    
   UserSql="Select [teacher_id],[teacher_name],[teacher_pass],[department_id] from [teacher] where teacher_name='"&Username&"'"
   UserRs.open UserSql,Initialize_Conn,1,1
    If UserRs.eof AND UserRs.bof then 
       Response.Write("<script>alert('教师的用户名不存在,请返回检查。');location.href='Default.htm';</script>")
       response.End()
     End If 
    If md5(Password) <> UserRs("teacher_pass") then
      Response.Write("<script>alert('教师的密码错误,请返回检查。');location.href='Default.htm';</script>")
      response.End()
     else
     Response.Cookies("teacher_Name") = UserRs("teacher_Name")
	 Response.Cookies("teacher_pass") = UserRs("teacher_pass")
	 Response.Cookies("teacher_id") = UserRs("teacher_id")
	 Response.Cookies("department_id") = UserRs("department_id")
	 Response.Redirect("Teacher.asp")
	 UserRs.close
	 Set UserRs=nothing
    End IF   

else 
    UserSql="Select [student_id],[student_no],[student_pass],[student_name],[department_id],[teacher_id],[class_id] from [student] where student_no='"&Username&"'"
    UserRs.open UserSql,Initialize_Conn,1,1
    If UserRs.eof AND UserRs.bof then 
       Response.Write("<script>alert('学生学号不存在,请返回检查。');location.href='Default.htm';</script>")
       response.End()
     End If 
    If md5(Password) <> UserRs("student_pass") then
      Response.Write("<script>alert('学生的密码错误,请返回检查。');location.href='Default.htm';</script>")
      response.End()
     else
     Response.Cookies("student_id") = UserRs("student_id")
	 Response.Cookies("student_no") = UserRs("student_no")
	 Response.Cookies("student_name") = UserRs("student_name")
	 Response.Cookies("student_pass") = UserRs("student_pass")
	 Response.Cookies("department_id") = UserRs("department_id")
	 Response.Cookies("teacher_id") = UserRs("teacher_id")
	 Response.Cookies("class_id") = UserRs("class_id")
	 UserRs.close
	 Set UserRs=nothing
	 Response.Redirect("Student.asp")
    End IF   
  
End if
%>

⌨️ 快捷键说明

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