request.ServerVariables("QUERY-STRING")为什么总返回空值
这是我自己练习的一段小程序、request.ServerVariables("QUERY-STRING")第一次调用时是空值应该没错但当我添加完数据提交后仍然他是空值,不知道为什么,我是asp初学者请大家帮帮我
<%@ language=vbscript%>
<%
'本程序有用,可以移植到JSP中,有问题,第一个页面总是显示不出来
dim strname,strtitle,strsports
if (request.ServerVariables("QUERY-STRING")<>"") then
strname=trim(request.QueryString("username"))
if(request.QueryString("title")="mr")then
strtitle="先生"
else
strtitle="女士"
end if
strsports=request.QueryString("sports")
%>
<html>
<body>
以下是从表单中获取的数据<hr>
姓名: <%=strname%> <br>
称谓: <%=strtitle%> <br>
体育爱好: <%=strsports%> <br>
</body>
</html>
<%
else '当查询字符串为空
%>
<html>
<body>
请填写以下信息
<form method="get" action="<%=request.ServerVariables("SCRIPT-NAME")%>">
姓名:<input type="text" name="username"><br>
称谓:<input type="radio" name="title" value="mr" checked>先生
<input type="radio" name="title" value="ms"> 女士 <br>
体育爱好: <br>
<select name="sports" multiple size=3>
<option>足球
<option>排球
<option>蓝球
<option>网球
<option selected>围棋
<option>象棋
</select>
<br>
<input type="Submit" value="提交"><input type="reset" value="重置">
</form>
</body>
</html>
<%end if%>