Avatar billede tbb Nybegynder
12. februar 2003 - 10:24 Der er 10 kommentarer og
1 løsning

Domain Checker

Jeg leder efter en doamin checker i ASP der tager højde for de top-domainer der ikke supportet under 3 tegn i navnet..

Dvs. at hvis man søger på et domaine f.eks. www.jj.info kommer der en advarsel op på .info, men hvis man søger på .com skal den ikke komme med en advarsel.

Se http://www.speedmanes.com.

Jeg har fundet en del domain checker ude på nettet, men der er ingen der 100% understøtter det jeg søger..

Hvem kan hjælpe ???

Thomas
Avatar billede somaliomar Praktikant
12. februar 2003 - 11:12 #1
Hvad er det for nogle domain checker du har fundet? Kan du ikke bare bruge en standard domain checker og lave en kode, der tester top-domain'et? Et eksempel

Dim strDomain As String
Dim strTopDomain As String

strDomain = "http://www.google.com"
strTopDomain = Mid(strwww, InStrRev(strwww, ".") + 1)
If Len(strTopDomain) > 3 Then
    'ADVARSEL
End If
Avatar billede somaliomar Praktikant
12. februar 2003 - 11:14 #2
Der var en fejl. Sådan skal det være:

Dim strDomain As String
Dim strTopDomain As String

strDomain = "http://www.google.com"
strTopDomain = Mid(strDomain, InStrRev(strDomain, ".") + 1)
If Len(strTopDomain) > 3 Then
    'ADVARSEL
End If
Avatar billede tbb Nybegynder
12. februar 2003 - 12:22 #3
Du har fat i noget af det rigtige...

Men jeg vil gerne have at min domain_checker kommer op med alternative svar, som f.eks hvis man søger på www.xx.info, kommer den også med et alternativ svar på f.eks. www.xx.dk, www.xx.com, www.xx.biz osv.

Og der har jeg så problemet, jeg kan kun får mit script til at tjekke feks. .info, men så kommer den ikke med en advarsel på de andre top-domainer..

Det er jo heller ikke den alle, der skal vises en advarsel ved, man kan jo godt købe et www.xx.com domaine....
Avatar billede somaliomar Praktikant
12. februar 2003 - 12:25 #4
Hvordan ser hele scriptet ud?
Avatar billede tbb Nybegynder
12. februar 2003 - 16:04 #5
<% Option Explicit %>
<%
Response.Buffer = False

Server.ScriptTimeout = 90

Private Function whoisResult(whoisURL, strMethod, strCheckString)

    Dim objXMLHTTP           
    Dim strWhoisResultString   

    Set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
   
        objXMLHTTP.Open strMethod, whoisURL, False
       
        objXMLHTTP.Send
       
        strWhoisResultString = objXMLHTTP.ResponseText
       
        'If the domain name is to short then tell them it's invalid
        If  Len(strDomainName) < 3 Then 
       
        'strSuffix = ".info" and strSuffix = ".biz"
            'Set the return result of the function to not valid
            whoisResult = "Not Valid - All .info and .biz must be at least 3 and max 63 characters"
               
        'Check the whois result to see if a result has NOT been found
        ElseIf InStr(1, strWhoisResultString, strCheckString, vbTextCompare) Then
           
            'Set the return result of the function to available
            whoisResult = "<font color=""#339900"" face=""Verdana"" size=""1"">Available &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=""bestil.htm""><img src=""images/info_img.gif"" width=""10"" height=""10"" align=""baseline"" border=""0""></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<select style=""font-family:Verdana,Arial;font-size:10px;""><option selected>$80/2years</option><option>$170/5years</option><option>$280/10years</option></select>&nbsp;&nbsp;<a href='bestil.htm'>Buy Now</a></font>"
           
        'Else if there is an error
        ElseIF InStr(1, strWhoisResultString, "Error", vbTextCompare) Then
           
            'Set the return result of the function to Taken
            whoisResult = "An Error has occured"
           
        'Else there was a result
        Else
           
            'Set the return result of the function to Taken
            whoisResult = "<font color=""#FF0000"" face=""Verdana"" size=""1"">Taken &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=""bestil.htm""><img src=""images/info_img.gif"" width=""10"" height=""10"" align=""baseline"" border=""0""></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='../whois/whois.asp'>Whois</a></font>"
        'End If
          End If
        'Clean up
        Set objXMLHTTP = Nothing
       
End Function


'Function to strip non alphanumeric characters
Private Function characterStrip(strTextInput)

    'Dimension variable
    Dim intLoopCounter     'Holds the loop counter
   
    'Loop through the ASCII characters up to - hyphen
    For intLoopCounter = 0 to 44
        strTextInput = Replace(strTextInput, CHR(intLoopCounter), "", 1, -1, 0)
    Next
   
    'Loop through the ASCII characters from hyphen to numeric charcaters
    For intLoopCounter = 46 to 47
        strTextInput = Replace(strTextInput, CHR(intLoopCounter), "", 1, -1, 0)
    Next
   
    'Loop through the ASCII characters numeric characters to lower-case characters
    For intLoopCounter = 58 to 96
        strTextInput = Replace(strTextInput, CHR(intLoopCounter), "", 1, -1, 0)
    Next
   
    'Loop through the extended ASCII characters
    For intLoopCounter = 123 to 255
        strTextInput = Replace(strTextInput, CHR(intLoopCounter), "", 1, -1, 0)
    Next
   
    'Return the string
    characterStrip = strTextInput
   
End Function


'Dimension variables
Dim strDomainName    'Holds the domain name to search for
Dim strSuffix        'Holds the domain name suffix to search

'Read in the domain name to search
strDomainName = Trim(Request.QueryString("domain"))
strSuffix = Trim(Request.QueryString("suffix"))

'If a domain name has been entred then strip any unwanted characters from it
If strDomainName <> "" Then
   
    'Convert the domain name to check to lower case
    strDomainName = LCase(strDomainName)
   
    'Remove www and http from in front
    strDomainName = Replace(strDomainName, "http://", "", 1, -1, 1)
    strDomainName = Replace(strDomainName, "www.", "", 1, -1, 1)
   
    'Remove suffixes
    strDomainName = Replace(strDomainName, ".com", "", 1, -1, 1)
    strDomainName = Replace(strDomainName, ".net", "", 1, -1, 1)
    strDomainName = Replace(strDomainName, ".org", "", 1, -1, 1)
    strDomainName = Replace(strDomainName, ".info", "", 1, -1, 1)
    strDomainName = Replace(strDomainName, ".biz", "", 1, -1, 1)
    strDomainName = Replace(strDomainName, ".tv", "", 1, -1, 1)
    strDomainName = Replace(strDomainName, ".name", "", 1, -1, 1)
    strDomainName = Replace(strDomainName, ".co.uk", "", 1, -1, 1)
    strDomainName = Replace(strDomainName, ".org.uk", "", 1, -1, 1)
    strDomainName = Replace(strDomainName, ".ltd.uk", "", 1, -1, 1)
    strDomainName = Replace(strDomainName, ".plc.uk", "", 1, -1, 1)
    strDomainName = Replace(strDomainName, ".net.uk", "", 1, -1, 1)
    strDomainName = Replace(strDomainName, ".me.uk", "", 1, -1, 1)
    strDomainName = Replace(strDomainName, ".pn.uk", "", 1, -1, 1)

    'Remove any hyphens from the first and last characters
    If Left(strDomainName, 1) = "-" Then strDomainName = Mid(strDomainName, 2, Len(strDomainName))
    If Right(strDomainName, 1) = "-" Then strDomainName = Mid(strDomainName, 1, Len(strDomainName)-1)

    'Remove any hyphens double hyphens
    strDomainName = Replace(strDomainName, "--", "-", 1, -1, 1)
   
    'Strip all non aphanumeric characters from the input
    strDomainName = characterStrip(strDomainName)
End If
%>
<html>
<head>
<title>Domain Name Checker</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body bgcolor="#8D929B" text="#000000" link="#0000CC" vlink="#0000CC" alink="#FF0000">
<center>
  <font face="Verdana, Arial, Helvetica, sans-serif"><b><font size="5">Domain Name Checker</font></b><br>
  <font size="-1">The Domain Name Checker will check the avialabilty of domains
  names in<br>
  .com, .net, .biz, info, .org, .co.uk, org.uk, net.uk, plc.uk, ltd.uk, .us</font></font>
</center>
<form strMethod="get" name="frmDomainCheck" action="domain_checker.asp">
  <table cellpadding="0" cellspacing="0" width="365" align="center">
    <tr>
      <td height="33" align="center" valign="middle"> <font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Domain
        Name Search: </font></td>
    </tr>
    <tr>
      <td width="365" height="37" align="center" valign="middle" background="images/checker_img.gif">
        <input style="font-family:Verdana,Arial;font-size:10px;" type="TEXT" name="domain" maxlength="35" size="20" value="<% = strDomainName %>">
        &nbsp;
        <select style="font-family:Verdana,Arial;font-size:10px;" name="suffix">
          <option<% If Request.QueryString("suffix") = "" OR Request.QueryString("suffix") = ".co.uk" Then Response.Write(" selected")%>>.co.uk</option>
          <option<% If Request.QueryString("suffix") = ".me.uk" Then Response.Write(" selected")%>>.me.uk</option>
          <option<% If Request.QueryString("suffix") = ".org.uk" Then Response.Write(" selected")%>>.org.uk</option>
          <option<% If Request.QueryString("suffix") = ".net.uk" Then Response.Write(" selected")%>>.net.uk</option>
          <option<% If Request.QueryString("suffix") = ".plc.uk" Then Response.Write(" selected")%>>.plc.uk</option>
          <option<% If Request.QueryString("suffix") = ".ltd.uk" Then Response.Write(" selected")%>>.ltd.uk</option>
          <option<% If Request.QueryString("suffix") = ".us" Then Response.Write(" selected")%>>.us</option>
          <option<% If Request.QueryString("suffix") = ".com" Then Response.Write(" selected")%>>.com</option>
          <option<% If Request.QueryString("suffix") = ".net" Then Response.Write(" selected")%>>.net</option>
          <option<% If Request.QueryString("suffix") = ".org" Then Response.Write(" selected")%>>.org</option>
          <option<% If Request.QueryString("suffix") = ".biz" Then Response.Write(" selected")%>>.biz</option>
          <option<% If Request.QueryString("suffix") = ".info" Then Response.Write(" selected")%>>.info</option>
        </select>
        &nbsp;
        <input type="submit" value="Search" name="submit" style="font-family:Verdana,Arial;font-size:10px;">
      </td>
    </tr>
  </table>
</form>
<table width="450" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center">
      <%
'If a domain name is enterd check it
If strDomainName <> "" Then
   
    'Display the avialbility
    Response.Write("<font face=""Verdana"" size=""1""><b>www." & strDomainName & strSuffix & " &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")
           
    'Call the domain checking function depending on domain suffix
   
    'Check for .co.uk
    If strSuffix = ".co.uk" Then
            Response.Write(whoisResult("http://195.66.240.196/cgi-bin/whois.cgi?query=" & strDomainName & ".co.uk", "GET", "No match"))

    'Check for .me.uk
    ElseIf strSuffix = ".me.uk" Then
        Response.Write(whoisResult("http://195.66.240.196/cgi-bin/whois.cgi?query=" & strDomainName & ".me.uk", "GET", "No match"))

    'Check for .org.uk
    ElseIf strSuffix = ".org.uk" Then
        Response.Write(whoisResult("http://195.66.240.196/cgi-bin/whois.cgi?query=" & strDomainName & ".org.uk", "GET", "No match"))
   
    'Check for .net.uk
    ElseIf strSuffix = ".net.uk" Then
        Response.Write(whoisResult("http://195.66.240.196/cgi-bin/whois.cgi?query=" & strDomainName & ".net.uk", "GET", "No match"))         

    'Check for .ltd.uk
    ElseIf strSuffix = ".ltd.uk" Then
        Response.Write(whoisResult("http://195.66.240.196/cgi-bin/whois.cgi?query=" & strDomainName & ".ltd.uk", "GET", "No match"))         
   
    'Check for .plc.uk
    ElseIf strSuffix = ".plc.uk" Then
        Response.Write(whoisResult("http://195.66.240.196/cgi-bin/whois.cgi?query=" & strDomainName & ".plc.uk", "GET", "No match"))         

    'Check for .us
    ElseIf strSuffix = ".us" Then
        Response.Write(whoisResult("http://www.whois.us/whois.cgi?TLD=us&WHOIS_QUERY=" & strDomainName & "&TYPE=DOMAIN", "GET", "no records"))
   
    'Check for .com
    ElseIf strSuffix = ".com" Then
        Response.Write(whoisResult("http://www-whois.internic.net/cgi/whois?whois_nic=" & strDomainName & ".com&type=domain", "GET", "No match"))
       
    'check for .net
    ElseIf strSuffix = ".net" Then
        Response.Write(whoisResult("http://www-whois.internic.net/cgi/whois?whois_nic=" & strDomainName & ".net&type=domain", "GET", "No match"))
   
    'Check for .org
    ElseIf strSuffix = ".org" Then
        Response.Write(whoisResult("http://www-whois.internic.net/cgi/whois?whois_nic=" & strDomainName & ".org&type=domain", "GET", "NOT FOUND"))
   
    'Check for .biz
    ElseIf strSuffix = ".biz" Then
        Response.Write(whoisResult("http://www-whois.internic.net/cgi/whois?whois_nic=" & strDomainName & ".biz&type=domain", "GET", "Not found"))

    'Check for .info
    ElseIf strSuffix = ".info" Then
        Response.Write(whoisResult("http://www-whois.internic.net/cgi/whois?whois_nic=" & strDomainName & ".info&type=domain", "GET", "NOT FOUND"))

    End If
    'Finsh the red span tag
    Response.Write("</b></font>")   
End If     

   
   
If strDomainName <> "" Then
   
    Response.Write("<br><br><table width=""365"" height=""24"" border=""0"" cellspacing=""0"" cellpadding=""0""><tr>")
    Response.Write("<td background=""images/text_img.gif"" align=""center""><font face=""Verdana"" size=""1"" color=""#FFFFFF""><b>Other Domain Name's</b></font></td>")
    Response.Write("</tr></table><br>")

                Response.Write("<font face=""Verdana"" size=""1""><b>www." & strDomainName &" .co.uk &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")

    strSuffix = ".co.uk"
        Response.Write(whoisResult("http://195.66.240.196/cgi-bin/whois.cgi?query=" & strDomainName & ".co.uk", "GET", "No match"))
    Response.Write("<br><br>")

                Response.Write("<font face=""Verdana"" size=""1""><b>www." & strDomainName &" .me.uk &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")
               
    strSuffix = ".me.uk"
        Response.Write(whoisResult("http://195.66.240.196/cgi-bin/whois.cgi?query=" & strDomainName & ".me.uk", "GET", "No match"))
    Response.Write("<br><br>")

                Response.Write("<font face=""Verdana"" size=""1""><b>www." & strDomainName &" .org.uk &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")

    strSuffix = ".org.uk"
        Response.Write(whoisResult("http://195.66.240.196/cgi-bin/whois.cgi?query=" & strDomainName & ".org.uk", "GET", "No match"))
    Response.Write("<br><br>")

                Response.Write("<font face=""Verdana"" size=""1""><b>www." & strDomainName &" .net.uk &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")

    strSuffix = ".net.uk"
        Response.Write(whoisResult("http://195.66.240.196/cgi-bin/whois.cgi?query=" & strDomainName & ".net.uk", "GET", "No match"))
    Response.Write("<br><br>")

                Response.Write("<font face=""Verdana"" size=""1""><b>www." & strDomainName &" .ltd.uk &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")

    strSuffix = ".ltd.uk"
        Response.Write(whoisResult("http://195.66.240.196/cgi-bin/whois.cgi?query=" & strDomainName & ".ltd.uk", "GET", "No match"))
    Response.Write("<br><br>")

                Response.Write("<font face=""Verdana"" size=""1""><b>www." & strDomainName &" .plc.uk &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")

    strSuffix = ".plc.uk"
        Response.Write(whoisResult("http://195.66.240.196/cgi-bin/whois.cgi?query=" & strDomainName & ".plc.uk", "GET", "No match"))
    Response.Write("<br><br>")

                Response.Write("<font face=""Verdana"" size=""1""><b>www." & strDomainName &" .us &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")

    strSuffix = ".us"
        Response.Write(whoisResult("http://www.whois.us/whois.cgi?TLD=us&WHOIS_QUERY=" & strDomainName & "&TYPE=DOMAIN", "GET", "no records"))
    Response.Write("<br><br>")

                Response.Write("<font face=""Verdana"" size=""1""><b>www." & strDomainName &" .com &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")

    strSuffix = ".com"
        Response.Write(whoisResult("http://www-whois.internic.net/cgi/whois?whois_nic=" & strDomainName & ".com&type=domain", "GET", "No match"))
    Response.Write("<br><br>")

                Response.Write("<font face=""Verdana"" size=""1""><b>www." & strDomainName &" .net &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")

    strSuffix = ".net"
        Response.Write(whoisResult("http://www-whois.internic.net/cgi/whois?whois_nic=" & strDomainName & ".net&type=domain", "GET", "No match"))
    Response.Write("<br><br>")

                Response.Write("<font face=""Verdana"" size=""1""><b>www." & strDomainName &" .org &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")

    strSuffix = ".org"
        Response.Write(whoisResult("http://www-whois.internic.net/cgi/whois?whois_nic=" & strDomainName & ".org&type=domain", "GET", "NOT FOUND"))
    Response.Write("<br><br>")

                Response.Write("<font face=""Verdana"" size=""1""><b>www." & strDomainName &" .biz &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")

    strSuffix = ".biz"
        Response.Write(whoisResult("http://www-whois.internic.net/cgi/whois?whois_nic=" & strDomainName & ".biz&type=domain", "GET", "Not found"))
    Response.Write("<br><br>")
               
                Response.Write("<font face=""Verdana"" size=""1""><b>www." & strDomainName &" .info &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")

    strSuffix = ".info"
        Response.Write(whoisResult("http://www-whois.internic.net/cgi/whois?whois_nic=" & strDomainName & ".info&type=domain", "GET", "NOT FOUND"))
    Response.Write("<br><br>")

End If
        %>
    </td>
  </tr>
</table>
 

</body>
</html>
Avatar billede tbb Nybegynder
12. februar 2003 - 16:08 #6
Mange af de top-domainer den tjekker her, er dog ikke de domainer jeg skal tjekke på i fremtiden. Det er kun til test....
Avatar billede tbb Nybegynder
14. februar 2003 - 09:50 #7
Er der ikke nogen der kan hjælpe ????
Avatar billede somaliomar Praktikant
14. februar 2003 - 11:49 #8
Hjælpe med hvad?
Avatar billede buzzer Nybegynder
14. februar 2003 - 16:06 #9
Måske dette kan hjælpe dig..: http://www.a-new-domain-name.com
Avatar billede tbb Nybegynder
14. februar 2003 - 16:07 #10
Tak for hjælpen buzzer. Det var lige hvad jeg skulle bruge......
Avatar billede tbb Nybegynder
14. februar 2003 - 16:10 #11
hmmm deres site er nede nu.....!!!!
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester