查看: 284|回复: 0

[ASP函数] 在 Classic ASP 中如何获取当前页面域名和完整超链接?

[复制链接]
xuanxiao 发表于 2022-8-6 12:11:24 | 显示全部楼层 |阅读模式
  1. response.write Request.ServerVariables("SERVER_NAME")'
  2. response.Write "<p>"& PageUrl &"</p>"

  3.   function PageUrl
  4.      dim sPort
  5.      sPort = Request.ServerVariables("SERVER_PORT")
  6.      if sPort = "80" then
  7.         sPort = ""
  8.      else
  9.         sPort = ":" & sPort
  10.      end if

  11.      PageUrl = "http://" & Request.ServerVariables("SERVER_NAME") & sPort & _
  12.                            Request.ServerVariables("URL") & "?" & _
  13.                            Request.ServerVariables("QUERY_STRING")
  14.   end function
复制代码


1.png
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表

在线客服

售前咨询
售后咨询
服务热线
023-58418553
微信公众号