您现在的位置是:网站首页> 编程资料编程资料
asp中获取当前页面的地址与参数的函数代码_应用技巧_
2023-05-25
349人已围观
简介 asp中获取当前页面的地址与参数的函数代码_应用技巧_
复制代码 代码如下:
Function getCurrentUrl()
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")
getCurrentUrl = strTemp
End Function
Function getUrlWithParams()
Dim ScriptAddress,Servername,qs
ScriptAddress = CStr(Request.ServerVariables("SCRIPT_NAME"))
Servername = CStr(Request.ServerVariables("Server_Name"))
qs=Request.QueryString
If Request.ServerVariables("SERVER_PORT") <> 80 Then
Servername = Servername & ":" & Request.ServerVariables("SERVER_PORT")
end if
if qs<>"" then
getUrlWithParams ="http://"& Servername & ScriptAddress &"?"&qs
else
getUrlWithParams ="http://"& Servername & ScriptAddress
end if
End Function
相关内容
- asp中文件与文件夹常用处理函数(文件后缀、创建文件等)_应用技巧_
- asp中格式化HTML函数代码 SDCMS加强版_应用技巧_
- asp中常用的字符串安全处理函数集合(过滤特殊字符等)_应用技巧_
- Asp中通过简单的例子理解下ByVal和ByRef的用法_应用技巧_
- asp中获取内容中所有图片与获取内容中第一个图片的代码_应用技巧_
- 获取一个数字的个位、十位、百位的函数代码_应用技巧_
- ASP同一站点下gb2312和utf-8页面传递参数乱码的终极解决方法_应用技巧_
- ASP中使用Set ors=oConn.Execute()时获取记录数的方法_应用技巧_
- ASP的URLDecode函数URLEncode解码函数_应用技巧_
- asp空间判断jmail组件是否安装或支持的代码_应用技巧_
