chklogin.asp

来自「基于ASP的网上考试系统源码」· ASP 代码 · 共 53 行

ASP
53
字号
<%
'程序名称:网上考试系统
'程序作者:韩波(bobby)
'OICQ:40274856   E-mail:bobbyhan@163.com
%>

<%
StudentID=Request("StudentID")
Name=Request("Name")
Subject=Request("Subject")
if StudentID="" then %>
<script language=vbscript>  
  		MsgBox "错误:请输入你的学号!"  
  		location.href = "javascript:history.back()"  
	  </script> 
	  <%
  end if
if Name="" then%><script language=vbscript>  
  		MsgBox "错误:请输入你的姓名!"  
  		location.href = "javascript:history.back()"  
	  </script> <%
end if%>
<!-- #include file="connect.asp" -->
<%
  rs.Open "Select * From 学生信息 where StudentID='"& StudentID &"'", conn,1,1%>
<%if rs.bof then %>
<script language=vbscript>  
  		MsgBox "错误:此学号不存在!"  
  		location.href = "javascript:history.back()"  
	  </script>
<%
elseif Name<>rs("Name") then%>
<script language=vbscript>  
  		MsgBox "错误:你的学号和你的姓名不一致,请查正!"  
  		location.href = "javascript:history.back()"  
	  </script>
<%end if
  rs.close
  rs.open "select * from 成绩表 where StudentID='"&StudentID&"' and 试卷名称='"&Subject&"'",conn,1,1

  if not rs.eof then%>
       <script language=vbscript>  
  		MsgBox "错误:你已经参加过这一门的考试了!"  
  		location.href = "javascript:history.back()"  
	  </script>
<%else 
   session("logstatus")=1 '记录登陆状态 
   response.redirect "testpaper.asp?"&Request.QueryString
end if
conn.close
set rs=nothing%>

⌨️ 快捷键说明

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