<% function isvalidurl(uri) 'change the case to make things easier uri = lcase(uri) 'if the uri starts with the protocol identifier and if so remove it if left(uri,7) = "http://" then uri = mid(uri,8) else uri = uri end if 'check for a trailing slash, then remove it if instr(uri,"/") > 0 then uri = left(uri,instrrev(uri,"/")-1) else uri = uri end if uriarr = split(uri,".") tld = uriarr(ubound(uriarr)) 'this is only the general tlds and does not include the country tlds tldarr = array("aero", "arpa", "asia", "biz", "cat", "com", "coop", "edu", "gov", "info", "int", "jobs", "mil", "mobi", "museum", "name", "net", "org", "pro", "tel", "travel") for i = 0 to ubound(tldarr) if tld = tldarr(i) then isurl = true exit for else isurl = false end if next isvalidurl = isurl end function %>