======== Get the URL with a port, we recommend using ==========================
Function get_scriptnameurl ()
If request. servervariables ("server_port") = "80" then
Get_scriptnameurl = "http: //" & request. servervariables ("SERVER_NAME") & lcase (request. servervariables ("script_name "))
Else
Get_scriptnameurl = "http: //" & request. servervariables ("SERVER_NAME") & ":" & request. servervariables ("server_port") & lcase (request. servervariables ("script_name "))
End if
End Function
'======================== Use a regular expression to highlight the function of displaying the words in the string ==================
Function boldword (strcontent, word)
If word = "" then
Boldword = strcontent
Exit Function
End if
Dim objregexp
Set objregexp = new Regexp
Objregexp. ignorecase = true
Objregexp. Global = true
Objregexp. pattern = "(" & word &")"
Strcontent = objregexp. Replace (strcontent, "<font color =" "# ff0000" "> <B> $1 </B> </font> ")
Set objregexp = nothing
Boldword = strcontent
End Function
'====================== Obtain the current IP address of the user ==========================
Function getip ()
UIP = request. servervariables ("http_x_forwarded_for ")
If UIP = "" Then UIP = request. servervariables ("remote_addr ")
Getip = UIP
End Function
'================== obtain the script path of the current Program ==== ===============< br> function getscriptname ()
scriptaddress = CSTR (request. servervariables ("script_name") 'gets the current address
If (request. querystring <> "") Then
scriptaddress = scriptaddress &"? "& Server. htmlencode (request. querystring) 'Get the address with parameters
end if
If Len (scriptaddress)> 250 then scriptaddress = left (scirptaddress, 250 )&"... "'path truncation, up to 250 characters
getscriptname = scriptaddress
end function
'=========== return a URL with parameters, when sorting multiple keywords, use =================< br> 'removelist parameter: parameters to be removed from the URL, which can be multiple, separate them with commas (,)
function keepurlstr (removelist)
scriptaddress = CSTR (request. servervariables ("script_name "))&"? "'Get the current address and add"?" Symbol
m_itemurl = ""
for each m_item in request. querystring
If instr (removelist, m_item) = 0 then
m_itemurl = m_itemurl & m_item & "=" & server. urlencode (request. querystring ("" & m_item &"")) & "&"
end if
next
keepurlstr = scriptaddress & m_itemurl
end function