ASP获取https完整URL路径的标准函数代码
来源:绵阳动力网络公司  时间:2020-03-02  阅读:10
SSL证书是数字证书的一种,类似于驾驶证、护照和营业执照的电子副本。网站使用SSL 证书 (SSL Certificates),并显示了签章 (Secured Seal),您的客户就知道他们的交易安全可靠,并且充分信赖您的网站。简单易懂的说法就是有SSL证书的网站网址开头是https而非普通网站的http。随着原来越多的网站使用SSL证书,获取当前页面的完整URL路径也会有所改变。ASP获取当前完整URL路径的函数代码在网上比较多,但获取https完整URL路径的确不多,今天绵阳动力网络就为大家来介绍关于ASP获取https完整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")
 strTemp = strTemp & Request.ServerVariables("URL")
 if trim(request.QueryString) <> "" Then strTemp = strTemp & "?" & Trim(Request.QueryString)
 GetUrl = strTemp
End Function
response.write GetUrl()
%>
通过以上代码就可以在获取https完整URL路径的同时也可以获取http的完整URL路径。
 
  • 电话咨询

  • 0816-2318288