receivedata.asp
来自「eayanQuery思燕大学成绩查询系统 版本 V1.6」· ASP 代码 · 共 57 行
ASP
57 行
<%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 + =
减小字号Ctrl + -
显示快捷键?