ASP function set
'========== Get the URL with port, it is recommended to use ======================
FunctionGet_ScriptNameUrl()
Ifrequest.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"))
EndIf
EndFunction
'===================== Function to highlight the words found in the string with regular expressions=================================
FunctionBoldWord(strContent,word)
Ifword=""Then
BoldWord=strContent
ExitFunction
EndIF
dimobjRegExp
SetobjRegExp=newRegExp
objRegExp.IgnoreCase=true
objRegExp.Global=True
objRegExp.Pattern="("&word&")"
strContent=objRegExp.Replace(strContent,"<fontcolor=""#FF0000""><b>$1</b></font>")
SetobjRegExp=Nothing
BoldWord=strContent
EndFunction
'======================= Get the user's current IP address====================
FunctionGetIP()
uIP=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
IfuIP=""ThenuIP=Request.ServerVariables("REMOTE_ADDR")
GetIp=uIP
EndFunction
'==================== Get the current program script path=====================
FunctionGetScriptName()
ScriptAddress=CStr(Request.ServerVariables("SCRIPT_NAME"))'Get the current address
If(Request.QueryString<>"") Then
ScriptAddress=ScriptAddress&"?"&Server.HTMLEncode(Request.QueryString)'Get the address with parameter
EndIf
IfLen(ScriptAddress)>250ThenScriptAddress=Left(SciptAddress,250)&"..."' for path intercepting, with a maximum of 250 characters
GetScriptName=ScriptAddress
EndFunction
'================ Return Url with parameters, used when sorting multiple keywords =====================
'RemoveList parameter: The parameters that need to be removed from the Url can be multiple, please separate them with commas in the middle.
FunctionKeepUrlStr(RemoveList)
ScriptAddress=CStr(Request.ServerVariables("SCRIPT_NAME"))&"?"'Get the current address and add the "?" symbol
M_ItemUrl=""
ForEachM_itemInRequest.QueryString
IfInStr(RemoveList,M_Item)=0Then
M_ItemUrl=M_ItemUrl&M_Item&"="&Server.URLEncode(Request.QueryString(""&M_Item&""))&"&"