Use XMLHTTP to detect URLs and detect server information
Please enter the URL:
Detection
DIM I, JNKCURL, JNKCHTML, JNKCSTATUS, JNKCSERVER
Function chK_ONCLICK ()
Jnkcurl = JNKCINPUT.VALUE
Call getDetail
i = i 1
JNKC_SHOW.INNERHTML = "
"& I & JNKCURL &" & JNKCSTATUS & "& JNKC_SHOW.INNERHTML
END FUNCTION
DIM JNKCXMLHTTP
Sub getdetail
? Set jnkcxmlhttp = creteObject ("Microsoft.xmlhttp")
? jnkcxmlhttp.onReadyStateChange = GetRef ("getStatus")
? JNKCXMLHTTP.Open "get", Jnkcurl, False
? On Error ResMe Next NEXT
? jnkcxmlhttp.send
? Set jnkcxmlhttp = Nothing
End Sub
Sub getStatus
? If jnkcxmlhttp.readystate <> 4 THEN
? EXIT SUB
? END IF
? If jnkcxmlhttp.status = 404? THEN
JNKCSTATUS = "This page does not exist!"
Elseif Jnkcxmlhttp.status <200 THEN
? jnkcstatus = "Client error, information:" & cstr (jnkcxmlhttp.status) & "& jnkcxmlhttp.statustext
Elseif Jnkcxmlhttp.status <300 THEN
JNKCSTATUS = "Success, the page can be accessed."
? Elseif jnkcxmlhttp.status <400 THEN
? JNKCSTATUS = "Redirection, Information:" & CSTR (JNKCXMLHTTP.STATUS & "& JNKCXMLHTTTP.STATUSTEXT
? Elseif jnkcxmlhttp.status <500 THEN
? jnkcstatus = "Client error, information:" & cstr (jnkcxmlhttp.status) & "& jnkcxmlhttp.statustext
? Elseif jnkcxmlhttp.status <600 THEN
? JNKCSTATUS = "server error, information:" & cstr (jnkcxmlhttp.status) & "& jnkcxmlhttp.statustext
? Else
• JNKCSTATUS = "Domain Names or Network Connection Errors, Information:" & CSTR (JNKCXMLHTTP.STATUS & "& JNKCXMLHTTTP.STATUSTEXT? END IF
? If jnkcxmlhttp.status <600 TEN CALL GETSERVER
End Sub
SUB GetServer
JNKCSERVER = JNKCXMLHTTP.GETRESPONSEHEADER ("Server")
? If jnkcserver <> "" "" "
? jnkcstatus = jnkcstatus & "
HTTP server: "& JNKCSERVER
? END IF
? JNKCSTATUS = "
"& JNKCSTATUS &"
All feedback information:
"& jnkcxmlhttp.getallResponseheaders
End Sub
script>