response.redirect格式

thunderingman 2008-11-08 07:25:39
if request("realname")<>"" then
sql="select * from user where realname='"&request("realname")&"'"
Set rs=db.execute(sql)
if rs.EOF or rs.BOF then
response.write "<script>alert('输入错误');history.go(-1)</script>"
else
Session("userid")=rs("id")
Response.Redirect("my_borrow.asp?id=Session("userid")")
end if
end if


这样写对吗?
...全文
70 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
翔之光 2008-11-09
  • 打赏
  • 举报
回复
Response.Redirect("my_borrow.asp?id="&Session("userid"))

帮你分析一下以后就不会错了

Redirect的参数是URL字符串要用""包围他,但是又因为你要用到Session对象所以就需要"http://www.123.com/456.asp?id=" & Session("UserID")
后面没有其他需要的了所以直接)就可以了如果后面ASP语句还有就要加上& 如果后面还有URL就需要&“


比如说你要456.asp?UserID=1&key=abc
Response.Redirect("http://www.123.com/456.asp?id=" & Session("UserID") & "&key=abc")

明白了吗?
zjljqlbtx 2008-11-08
  • 打赏
  • 举报
回复
Response.Redirect("my_borrow.asp?id="&Session("userid"))
chengdong284 2008-11-08
  • 打赏
  • 举报
回复
Response.Redirect("my_borrow.asp?id="&Session("userid"))
xiaojing7 2008-11-08
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 KingNE 的回复:]
Response.Redirect("my_borrow.asp?id="&Session("userid"))

[/Quote].
KingNE 2008-11-08
  • 打赏
  • 举报
回复
Response.Redirect("my_borrow.asp?id="&Session("userid"))
紫气东来_999 2008-11-08
  • 打赏
  • 举报
回复
Response.Redirect("my_borrow.asp?id="&Session("userid"))
UP
neo_yoho 2008-11-08
  • 打赏
  • 举报
回复
Response.Redirect("my_borrow.asp?id="&Session("userid"))

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧