ASP中,有几种方式可以得到进入本页前的URL地址?

<%

  
Function   GetUrl()   
      
On   Error   Resume   Next   
      
Dim   strTemp   
  
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   
      GetUrl   
=   strTemp   
  
End   Function   
    
    
  response.write   
"from:"   &   geturl()   
  response.end()   

%
>


Request.ServerVariables("HTTP_REFERER")  

申明

非源创博文中的内容均收集自网上,若有侵权之处,请及时联络,我会在第一时间内删除.再次说声抱歉!!!

博文欢迎转载,但请给出原文连接。

原文地址:https://www.cnblogs.com/Athrun/p/1119203.html