请高手看看我这段ASP代码中response.redirect为什么不起作用? 急~~急~~急~~急

来源:百度知道 编辑:UC知道 时间:2024/05/30 03:16:45
<%
If Request.Form("yonghuming")<>"" Then
If Request.Form("yonghuming")="1"and Request.Form("mima")="110" Then
Session("queding")="OK"
response.redirect ("huanying.asp")
else
cmsg="你输入错误"
end If
end If
%>

~~~输入用户名和密码~~不跳转还是原样~~~上面的URL变成http://localhost/%E7%BD%91%E9%A1%B51/shouye.asp
以前是http://localhost/网页1/shouye.asp

路径最好不要用中文
你试试这个
http://localhost/网页1/shouye.asp?yonghuming=1&mima=110
看有没效果?

还是因为你的用户名为空,所以没有转向。

你可以先不去理会跳转,而是做断点测试,,,
比如:第一步
<%
If Request.Form("yonghuming")<>"" Then
'这里写入
response.write("aaa")

If Request.Form("yonghuming")="1"and Request.Form("mima")="110" Then
Session("queding")="OK"

response.write("bbb")
'下面的注释掉
,response.redirect ("huanying.asp")

else
cmsg="你输入错误"
end If
end If
%>
看看是不是执行到 response.redirect ("huanying.asp") 这一步...
因为也许因为某些条件未能满足,程序根本就没有执行到你所关注的那部分.
ASP我放弃几年了,现在一直搞JSP.
提醒你一句:找解决问题的方法永远比找到问题的答案重要.我写程序时自己总是来设置断点来查错,这一方法非常有效.

可能是1 提交语句出现错误'
<form action="shouye.asp">