asp值传输问题
<%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
%>
<%
userip = Request.ServerVariables("HTTP_X_FORWARDED_FOR") '获取用户客户端IP
If userip = "" Then
userip = Request.ServerVariables("REMOTE_ADDR")
end if
rs.open "select * from 试卷信息 where 试卷名称='"&Subject&"'",conn,1,1
if rs("ip地址1")>userip then
Response.write "该机器不允许参加考试!"
Response.End
end if
if rs("ip地址2")<userip then
Response.write "该机器不允许参加考试!"
Response.End
end if
rs.close
%>
<%
v=now()
rs.open "select * from 试卷信息 where 试卷名称='"&Subject&"'",conn,1,1
t1=rs("考试时间1")
t2=rs("考试时间2")
if t1>now() then
Response.write "考试时间还没有到,请稍后!"
Response.end
end if
if t2<now() then
Response.write "您已经错过考试时间!补考吧!"
Response.end
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 "test易做图.asp?"&Request.QueryString
end if
conn.close
set rs=nothing%>
这是chklogin.asp文件的代码, 问题是:可以从定向到test易做图.asp,但是不能判断前面的准考证号和姓名,如果把"response.redirect "test易做图.asp?"&Request.QueryString"这句注释掉,则可以判断以上条件.
现在想如何能实现判断以上条件,并能把参数传递过去. --------------------编程问答-------------------- response.redirect "test易做图.asp?"&Request.QueryString跟判断前面的准考证号和姓名有什么关系?想不通 --------------------编程问答-------------------- 没弄过asp 帮顶 --------------------编程问答-------------------- response.write "test易做图.asp?"&Request.QueryString
可以得到下面的
test易做图.asp?StudentID=600743&Name=%E3%C6%D0%A3%C9%FA&Subject=%D0%C5%B4%FB%BF%BC%CA%D4&send=%B5%C7%C2%BC
而且代码上面的检查条件也可以顺利进行
补充:.NET技术 , ASP.NET