asp获得完整来源网址
作者:admin 日期:2009-05-29
Function GetUrl()
Dim ScriptAddress, M_ItemUrl, M_item,urlid,urlid2
ScriptAddress = CStr(Request.ServerVariables("SCRIPT_NAME"))
M_ItemUrl = ""
If (Request.QueryString <> "") Then
ScriptAddress = ScriptAddress & "?"
For Each M_item In Request.QueryString
If InStr(page,M_Item)=0 Then
M_ItemUrl = M_ItemUrl & M_Item &"="& Server.URLEncode(Request.QueryString(""&M_Item&"")) & "&"
End If
Next
If right(M_ItemUrl,1) = "&" Then M_ItemUrl = Left(M_ItemUrl,Len(M_ItemUrl)-1)
end if
GetUrl ="http://"&Request.ServerVariables("Server_Name")&ScriptAddress & M_ItemUrl
urlid =InStr(GetUrl,"&page")
urlid2 =InStr(GetUrl,"?page")
'----------去除当前页的page参数--------
if urlid<>0 then
GetUrl=left(GetUrl,urlid-1)&"&"
end if
if urlid2<>0 then
GetUrl=left(GetUrl,urlid2-1)&"?"
end if
'----------去除当前页的page参数--------
End Function
广告位