Avatar billede nightowl24 Nybegynder
26. april 2005 - 11:03 Der er 10 kommentarer og
2 løsninger

Web Wiz ASP domæne tester

Hej

Jeg har downloadet web wiz asp domæne tester og vil forsøge at ændre den så man kan teste på dk domæner.

Er der nogen der har haft held med dette?

Koden:


<% Option Explicit %>
<%
'****************************************************************************************
'**  Copyright Notice   
'**
'**  Web Wiz Guide ASP Domain Checker
'**                                                                                           
'**  Copyright 2001-2002 Bruce Corkhill All lefts Reserved.                               
'**
'**  This program is free software; you can modify (at your own risk) any part of it
'**  under the terms of the License that accompanies this software and use it both
'**  privately and commercially.
'**
'**  All Copyright notices must remain in tacked in the scripts and the
'**  outputted HTML.
'**
'**  You may use parts of this program in your own private work, but you may NOT
'**  redistribute, repackage, or sell the whole or any part of this program even
'**  if it is modified or reverse engineered in whole or in part without express
'**  permission from the author.
'**
'**  You may not pass the whole or any part of this application off as your own work.
'** 
'**  All links to Web Wiz Guide and powered by logo's must remain unchanged and in place
'**  and must remain visible when the pages are viewed unless permission is first granted
'**  by the Copyright holder.
'**
'**  This program is distributed in the hope that it will be useful,
'**  but WITHOUT ANY WARRANTY; without even the implied warranty of
'**  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR ANY OTHER
'**  WARRANTIES WHETHER EXPRESSED OR IMPLIED.
'**
'**  You should have received a copy of the License along with this program;
'**  if not, write to:- Web Wiz Guide, PO Box 4982, Bournemouth, BH8 8XP, United Kingdom.
'**   
'**
'**  No official support is available for this program but you may post support questions at: -
'**  http://www.webwizguide.info/forum
'**
'**  Support questions are NOT answered by e-mail ever!
'**
'**  For correspondence or non support questions contact: -
'**  info@webwizguide.com
'**
'**  or at: -
'**
'**  Web Wiz Guide, PO Box 4982, Bournemouth, BH8 8XP, United Kingdom
'**
'****************************************************************************************



'Set the response buffer to true
Response.Buffer = False

'Set the script timeout to 90 seconds
Server.ScriptTimeout = 90

'Whois function to query the whois server
Private Function whoisResult(whoisURL, strMethod, strCheckString)

    'Dimension variables
    Dim objXMLHTTP            'Holds the XML HTTP Object
    Dim strWhoisResultString    'Holds the reult of the whois query

    'Create an XML object to query the remote whois server
    Set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
   
    'Alternative XML HTTP component, for version 3.0 of XMLHTTP
      'Set objXMLHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")

    'Open a connection to the remote whois server
        objXMLHTTP.Open strMethod, whoisURL, False
       
        'Send the request and return the data
        objXMLHTTP.Send
       
        'Place the whois registry response into the result string
        strWhoisResultString = objXMLHTTP.ResponseText
       
        'If the domain name is to short then tell them it's invalid
        If Len(strDomainName) < 3 Then
           
            'Set the return result of the function to not valid
            whoisResult = "Not Valid - must be at least 3 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 = "Available"
           
        '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 = "Taken"
        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, ".dk", "", 1, -1, 1)
    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>

<!-- The Web Wiz Guide ASP Domain Checker is written and produced by Bruce Corkhill ©2002
        If you want your own ASP Domain Checker then goto http://www.webwizguide.info -->

</head>
<body bgcolor="#FFFFFF" text="#000000" link="#0000CC" vlink="#0000CC" alink="#FF0000">
<center>
<font size="5"><b><font face="Arial, Helvetica, sans-serif"> Domæne tester</font></b></font><br>
The Domain Name Checker will check the availability of domain names in<br>
.dk, .com, .net, .biz, info, .org, .co.uk, org.uk, net.uk, plc.uk, ltd.uk
</center>
<form strMethod="get" name="frmDomainCheck" action="domain_checker.asp">
<table cellpadding="0" cellspacing="0" width="500" align="center">
  <tr>
  <td height="66" width="111" align="right" rowspan="3" valign="middle"><img src="domain_search.gif" width="49" height="53" align="absmiddle" alt="Domain Name Search"> </td>
  <td height="66" width="31" align="left" rowspan="3" valign="middle">&nbsp;</td>
  <td class="arial" height="4" width="356"> Domain Name Search: </td>
  </tr>
  <tr>
  <td class="normal" height="2" width="356">
    <input type="TEXT" name="domain" maxlength="35" size="20" value="<% = strDomainName %>">
    <select name="suffix">
    <option<% If Request.QueryString("suffix") = "" OR Request.QueryString("suffix") = ".dk" Then Response.Write(" selected")%>>.dk</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>
    <input type="submit" value="Search &gt;&gt;" name="submit">
  </td>
  </tr>
  <tr>
  <td class="normal" height="34" width="356" valign="top">&nbsp;</td>
  </tr>
</table>
</form>
<center>
<%
'If a domain name is enterd check it
If strDomainName <> "" Then
   
    'Display the avialbility
    Response.Write("<b>www." & strDomainName & strSuffix & " is<br><font color=""color: #FF0000;"">")
           
    'Call the domain checking function depending on domain suffix
   
    'Check for .dk
    If strSuffix = ".dk" Then 
        Response.Write(whoisResult("http://www.dnsstuff.com/tools/whois.ch?ip=" & strDomainName & ".dk", "GET", "No match"))

    'Check for .me.uk
    ElseIf strSuffix = ".me.uk" Then 
        Response.Write(whoisResult("http://cgi.nic.uk/cgi-bin/whois.cgi?query=" & strDomainName & ".me.uk", "GET", "No match"))
   
    'Check for .org.uk
    ElseIf strSuffix = ".org.uk" Then 
        Response.Write(whoisResult("http://cgi.nic.uk/cgi-bin/whois.cgi?query=" & strDomainName & ".org.uk", "GET", "No match"))
   
    'Check for .net.uk
    ElseIf strSuffix = ".net.uk" Then 
        Response.Write(whoisResult("http://cgi.nic.uk/cgi-bin/whois.cgi?query=" & strDomainName & ".net.uk", "GET", "No match"))         
   
    'Check for .ltd.uk
    ElseIf strSuffix = ".ltd.uk" Then 
        Response.Write(whoisResult("http://cgi.nic.uk/cgi-bin/whois.cgi?query=" & strDomainName & ".ltd.uk", "GET", "No match"))         
   
    'Check for .plc.uk
    ElseIf strSuffix = ".plc.uk" Then 
        Response.Write(whoisResult("http://cgi.nic.uk/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("</font></b>")   
End If     
            %>
<br><br>
<br>
<%                 
'***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
Response.Write("Powered By - <a href=""http://www.webwizguide.info"" target=""_blank"">www.webwizguide.info</a>")
'***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
%>
<br>
<br>
<a href="http://www.webwizguide.info" target="_blank"><img src="web_wiz_guide.gif" width="100" height="30" border="0" alt="Web Wiz Guide!"></a></center>
<br>
</body>
</html>

/Nightowl
Avatar billede moejensen Nybegynder
26. april 2005 - 11:13 #1
det ser da ud ti lat den er lavet, så den kan teste dk domæner
Avatar billede moejensen Nybegynder
26. april 2005 - 11:16 #2
Jeg har lige prøvet det, og jeg kan fint teste dk domæner. Er det mig der ikke helt forstår hvad du mener?
Avatar billede cpufan Juniormester
26. april 2005 - 11:23 #3
If strSuffix = ".dk" Then 
        Response.Write(whoisResult("http://www.dk-hostmaster.dk/dkhostcms/bs?pageid=82&action=cmsview&lang=da&query=" & strDomainName & ".dk", "GET", "Søgningen gav ikke"))

ville jeg nok bruge istedet for....
men jeg har do oplevet problemer med dk-host på det område, så jeg tester op mod ripe.net
Avatar billede nightowl24 Nybegynder
26. april 2005 - 11:48 #4
Jeg har selv forsøgt, men hvis jeg indtaster et domæne der ikke er taget(fx lululul.dk) siger den stadig at den er taget. Det gør den måske ikke når I tester?
Avatar billede moejensen Nybegynder
26. april 2005 - 13:15 #5
jeg kan godt se problemet, jeg får også taken på alle domæner.

Mon der ikke er flere ledige danske domænenavne ;-))))
Avatar billede cpufan Juniormester
26. april 2005 - 13:15 #6
har du ændret til denne:

If strSuffix = ".dk" Then 
        Response.Write(whoisResult("http://www.dk-hostmaster.dk/dkhostcms/bs?pageid=82&action=cmsview&lang=da&query=" & strDomainName & ".dk", "GET", "gningen gav ikke"))

udelad evt. Sø som jeg har gjort her ovenover
Avatar billede nightowl24 Nybegynder
26. april 2005 - 13:18 #7
Det ændre ingenting, får stadig taken på alle domæner
Avatar billede moejensen Nybegynder
26. april 2005 - 13:19 #8
så fandt jeg fejlen, du skal rette denne linie:

If strSuffix = ".dk" Then 
            Response.Write(whoisResult("http://www.dnsstuff.com/tools/whois.ch?ip=" & strDomainName & ".dk", "GET", "No entries found"))
Avatar billede moejensen Nybegynder
26. april 2005 - 13:21 #9
hvis du bruger den oprindelige side ti ldk opslag, skal der stå "No entries found" til sidst i stdet for "No match", da det er den errstring den skla kige efter på siden
Avatar billede cpufan Juniormester
26. april 2005 - 13:28 #10
vil foreslå du bruger:
http://ripe.net/fcgi-bin/whois?form_type=simple&submit.x=11&submit.y=7&searchtext=

og så

"No entries found"

Så får du ikke brok fra dnsstuff.com som sikkert er en privat
Avatar billede nightowl24 Nybegynder
26. april 2005 - 13:29 #11
Jep, nu virker det, cpufan, du kan lige smide et svar, så kan I dele
Avatar billede cpufan Juniormester
26. april 2005 - 13:39 #12
kommer her
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