Method 1: simple. There is no parameter, and there is only one virtual path.
CopyCode The Code is as follows: geturl = request ("url ")
Example: http: // 127.0.0.1/Shiyan. asp? Dfsdfsf = dsfsdfd & aa = dddd
Obtain Shiyan. aspCopy codeThe Code is as follows: <%
Dim Changdu, URL, ends, Wurl
Changdu = Len (request. servervariables ("url "))
Url = 2.16rev (request. servervariables ("url "),"/")
Url = URL + 1
Ends = Changdu + 1-url
Wurl = mid (request. servervariables ("url"), URL, ends)
%>
Method 2: Obtain the entire URL and obtain the parameters. Copy codeThe Code is as follows: 'get the address of the current page
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
Example: http: // 127.0.0.1/Shiyan. asp? Dfsdfsf = dsfsdfd & aa = dddd
Get http: // 127.0.0.1/Shiyan. asp? Dfsdfsf = dsfsdfd & aa = dddd
method 3: Obtain the virtual path. Obtain the parameter copy Code the code is as follows: Private function geturl ()
dim scriptaddress, m_itemurl, m_item
scriptaddress = CSTR (request. servervariables ("script_name") 'gets the current address
m_itemurl = ""
If (request. querystring <> "") Then
scriptaddress = scriptaddress &"? "
for each m_item in request. querystring
If m_item = "page_num" then exit for 'the function here is to filter out the page_num page parameters (this parameter is set in page_turn.asp, changes based on personal settings). Otherwise, this parameter will be added every time you flip the page. Although this parameter does not affect the function, it is always not good ~~
If instr (page, m_item) = 0 then
m_itemurl = m_itemurl & m_item & "=" & server. urlencode (request. querystring ("& m_item &")
else
m_itemurl = m_itemurl & m_item & "=" & server. urlencode (request. querystring ("& m_item &") & "&"
end if
next
else
scriptaddress = scriptaddress &"? "
end if
geturl = scriptaddress & m_itemurl
end function
Example: http: // 127.0.0.1/Shiyan. asp? Dfsdfsf = dsfsdfd & aa = dddd
Get:/Shiyan. asp? Dfsdfsf = dsfsdfd & aa = dddd
Method 4: obtain only some parameters Copy codeThe Code is as follows: 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
Geturl = mid (geturl, instr (geturl ,"? ") + 1)
End Function
example: http: // 127.0.0.1/Shiyan. asp? Dfsdfsf = dsfsdfd & aa = dddd
: dfsdfsf = dsfsdfd & aa = dddd