Core code:
Verify that the input URL is valid and can access the <% ' ****************************** ' function: Urlok (strurl) ' parameter: strURL, to be verified URL ' date: 2007/7/13 ' Description: Verify that the input URL Valid and accessible ' Example: <%=urlok (' http://www.jb51.net ')%> ' ****************************** Function Urlok (strurl) on Error R Esume Next If strurl<> "" "Then Set objhttp = CreateObject (" MSXML2.
XMLHTTP ") Objhttp.open" get ", strURL, FALSE objhttp.send If InStr (Objhttp.statustext," OK ") Then Urlok =" valid "Else
Urlok = "Invalid" End If Else Urlok = "Error: You did not enter the URL!" The End If End Function%> a regular authentication url <% ' ****************************** ' function: Checkexp (PATRN,STRNG) ' parameter: patrn Regular expression; strng validation string ' Author: Arisisi ' Date: 2007/7/13 ' Description: Regular validation url ' example of whether the input URL is legitimate: <%=checkexp (patrn,strng)%> ' ****************
function Checkexp (patrn,strng) Dim regex,match Set regex = new RegExp ' establishes a regular expression.
Regex.pattern = Patrn ' Set mode.
Regex.ignorecase = True ' Sets whether character case is case-sensitive.
Regex.global = True ' sets global availability. matches = Regex.test (strng) checkexp = Matches End Function
%>