Results 1 to 5 of 5

Thread: Is it there?

  1. #1

    Thread Starter
    Registered User Flash d:)'s Avatar
    Join Date
    Nov 2000
    Location
    Michigan
    Posts
    15

    Question Is it there?

    I dont know any VB Script just to tell ya.


    I want to use vb script to see if a website exists. If it does then go to it, otherwise go to a different one. Is this possible?


    p.s. Client side

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    Code:
    <script language="VBScript">
    
    msgbox(VerifySite("http://www.vbforums.com"))
    msgbox(VerifySite("http://www.asl;fjasdlfkjasd;lf.com"))
    
    function VerifySite(SiteName)
    
    	on error resume next
    	dim objXMLHTTP
    	dim strText
    
    	set objXMLHTTP = createobject("Microsoft.XMLHTTP")
    
    	objxmlhttp.open "GET", SiteName, false
    	objxmlhttp.send
    
    	strText = objxmlhttp.responsetext
    
    	if trim(strText) = "" then
    		VerifySite = false
    	else 
    		VerifySite = true
    	end if
    
            set objxmlhttp = nothing
    end function
    </script>

  3. #3

    Thread Starter
    Registered User Flash d:)'s Avatar
    Join Date
    Nov 2000
    Location
    Michigan
    Posts
    15

    Talking Thankyou!!

    Thank you very much!!! Thats exactly what I wanted

  4. #4
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Can you also use that object to go to a site and find it's title?
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  5. #5
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Cheers!

    I'll be using that to find out names of sites when people type in addresses, in my forums
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width