url传值的问题

来源:百度知道 编辑:UC知道 时间:2024/06/17 10:45:08
我想用URL传值 没有表单提交,仅仅是在某个页面超级连接中的URL写成这样
index.asp?yes=1

然后在index.asp中开始一个判断
<%
dim yes
yes=request(yes)
if yes <> 1 then
response.Redirect("login.asp")
response.End
end if
%>

想这样来过滤只有我之前的那个连接能进来,别的连接不能进来。有什么问题吗?本人菜鸟,高手尽情指点。谢谢

这句错了,yes=request(yes)
改为:yes=request("yes")或request.QueryString("yes")

<%
dim yes
yes=request.QueryString("yes")
if yes <> 1 then
response.Redirect("login.asp")
response.End
end if
%>

"yes"是应用语句,不能当作变量?换个词试试