<%
StudentID=Request("StudentID")
ID=Request("ID")
Sname=Request("Sname")
Subject=Request("Subject")
if StudentID="" then %>
<script language=vbscript>
MsgBox "错误:请输入你的准考证号!"
location.href = "javascript:history.back()"
</script>
<%
end if
if ID="" then %>
<script language=vbscript>
MsgBox "错误:请输入你的身份证号!"
location.href = "javascript:history.back()"
</script>
<%
end if
if Sname="" then%>
<script language=vbscript>
MsgBox "错误:请输入你的姓名!"
location.href = "javascript:history.back()"
</script> <%
end if%>
<!-- #include file="conn.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 ID<>rs("ID") then%>
<script language=vbscript>
MsgBox "错误:你的信息不匹配,请查正!"
location.href = "javascript:history.back()"
</script>
<%
elseif Sname<>rs("Sname") 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 if Subject="行政职业能力测验"then
session("logstatus")=1 '记录登陆状态
response.redirect "testpaper.asp?"&Request.QueryString
else
session("logstatus")=1 '记录登陆状态
response.redirect "testpaper2.asp?"&Request.QueryString
end if
conn.close
end if
set rs=nothing%>