ASP function set

xiaoxiao2021-03-06  65

'======== acquired the URL with port, recommended ========================= 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 fnd function

'================= Use regular expressions to highlight the function of the words queried 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, " $ 1 )

Set objRegexp = Nothing boldword = strcontentend function

'=============== acquired the user's current IP address ============================ function getip () UIP = Request.ServerVariables "Http_x_forwarded_for") if uip = "" "" Remote_Addr ") getip = uipend function

'=============== acquired the current program script path =========================== function getScriptName () scriptaddress = cstr (Request.ServerVariables ("Script_name") 'gets the current address if (Request.QueryString <> ") THEN Scriptaddress = Scriptaddress &"? "& Server.htmlencode (Request.QueryString)' gets the parameter address end ifness"> 250 THEN Scriptaddress = Left (Scirptaddress, 250) & "..." performs path interception, maximum of 250 characters getScriptName = scriptaddressend function '=========== Return the URL with parameters, multi-key Use ========================================================================================================== # Request.ServerVariables ("Script_name") ") &"? "Gets 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 ("& M_Item &")) & "&" Endix ") &" & "End If Next Keepurlstr = Scriptaddress & M_Itemlend

转载请注明原文地址:https://www.9cbs.com/read-120039.html

New Post(0)