为什么这代码不能实现这些功能?

来源:百度知道 编辑:UC知道 时间:2024/05/08 16:27:55
哪个高手看一下这段代码,帮我解决一下呀!为什么在输入空时或什么都不输入也能进入考试,不能提示代码中的错误提示:
<%
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:histo

用正则表达式处理一下就好了。

<%
if StudentID="" then %> // 这里的问题

你也可以用

??
错误提示是什么。

VBS 应该是有 MSGBOX