菜菜问题:asp如何获取url参数并转跳?

jiasai 2007-02-24 10:59:11
如:123.com/url.asp?xxxx
我想把?后面的参数转跳到其他的页面
如:321.com/url.asp?xxxx

效果是这样的 当用户访问http://123.com/url.asp?xxxx时
页面直接转跳到http://321.com/url.asp?xxxx

“?”后面的参数不变~ 我是个菜菜 希望高手能给出全部代码~ 谢谢了先

联系QQ:178943328 给答案的 赠送QB.

我在网上找的代码:
<%
If LCase(Request.ServerVariables("HTTPS")) = "off" Then
strTemp = "http://"
Else
strTemp = "https://"
End If
strTemp = strTemp & Request.ServerVariables("SERVER_NAME")
If Request.ServerVariables("SERVER_PORT") <> 80 Then
strTemp = strTemp & ":" & Request.ServerVariables("SERVER_PORT")
end if
strTemp = strTemp & Request.ServerVariables("URL")
If Trim(Request.QueryString) <> "" Then
strTemp = strTemp & "?" & Trim(Request.QueryString)
end if

%>
<meta HTTP-EQUIV=refresh Content='0;url=http://321.com/url.asp?<%GetUrl = strTemp%>'>

这个我知道不对 不过估计差不多 希望 高手 不要见笑 给我说下 救人于水火之中 谢谢了先~!
...全文
906 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
renmasheshou 2007-02-25
  • 打赏
  • 举报
回复
ASP的。。。
cwwhy 2007-02-25
  • 打赏
  • 举报
回复
你找的代码太麻烦,是服务器端的代码。
客户端实现比较简单。
<script>
window.location.href = "http://321.com/url.asp" + window.location.search;
</script>

就跳转了
cwwhy 2007-02-25
  • 打赏
  • 举报
回复
用脚本吧
<script>
location.href = "http://321.com/url.asp" + location.search;
</script>
chuckcoin 2007-02-25
  • 打赏
  • 举报
回复
你这是要做一个严格的判断跳转还是只做一个简单的重定向?
nyzfl 2007-02-25
  • 打赏
  • 举报
回复
路过
winner2050 2007-02-25
  • 打赏
  • 举报
回复
Request.QueryString["参数"]
xie_yanke 2007-02-25
  • 打赏
  • 举报
回复
如果浏览器支持javascript的话.
<script>
location.href = "http://321.com/url.asp?" + location.search;
</script>
智能大石头 2007-02-25
  • 打赏
  • 举报
回复
<meta HTTP-EQUIV=refresh Content='0;url=http://321.com/url.asp?<%=Request.QueryString%>'>

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

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