Login or Sign Up to become a member!
LessThanDot Sit Logo

LessThanDot

Community Wiki

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot friendfeed Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Navigation

Google Ads

Checking URLs

From Wiki

Jump to: navigation, search

This example is adapted from classic ASP. You will need to ensure that the URL starts with "HTTP://". Be careful of False results, you may need to check further.

Example: Check whether a URL exists

   Function IsLink(url)
   Dim xmlhttp As Object
       
       Set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
       
       On Error Resume Next
       
       xmlhttp.Open "GET", url, False
       'This alternative can return status 405 in some cases
       'xmlhttp.Open "HEAD", url, False
       xmlhttp.Send ""
       
       'You can get the status of the page, if you wish
       Status = xmlhttp.Status
       
       If Err.Number <> 0 Or Status <> 200 Then
           IsLink = False
       Else
           IsLink = True
       End If
       
       Set xmlhttp = Nothing
       
   End Function

Further Information

99 Rating: 1.0/5 (2 votes cast)