Pessoal estou tentando melhorar este script para verificar se o dominio esta ou não registrado se ele esta registrado me mostra as informações do registro ok
O problema e que quando eu marco so os dominio internacional ele funciona perfeitamente já os dominio nacionais não esta funcionado.
se eu conseguir enviar os checkbox com os valores ".com.br,.net.br,.adv.br,.org.br,.tv.br,.gov.br,.adm.br" para ser pesquisado no registro br
e os checkbox com os valores ".com,.net,.org,.info" Internic
Exemplo:
Se for escolhido so dominio internacional ele tem que fazer a consulta só na linha azul e se for escolhido somente dominio nacional tem que fazer consulta só na linha vermelha e se for escolhido nacional e internacional tem que fazer consulta nas duas linha azul e vermelha
Pergunta
igadino
Pessoal estou tentando melhorar este script para verificar se o dominio esta ou não registrado se ele esta registrado me mostra as informações do registro ok
O problema e que quando eu marco so os dominio internacional ele funciona perfeitamente já os dominio nacionais não esta funcionado.
se eu conseguir enviar os checkbox com os valores ".com.br,.net.br,.adv.br,.org.br,.tv.br,.gov.br,.adm.br" para ser pesquisado no registro br
e os checkbox com os valores ".com,.net,.org,.info" Internic
Exemplo:
Se for escolhido so dominio internacional ele tem que fazer a consulta só na linha azul e se for escolhido somente dominio nacional tem que fazer consulta só na linha vermelha e se for escolhido nacional e internacional tem que fazer consulta nas duas linha azul e vermelha
If InStr(ext_perm, ",") > 0 Then
xmlhttp.Open "GET", "http://reports.internic.net/cgi/whois?whois_nic=" &Replace(endereco & dominio, " .",".")& "&type=domain", False
xmlhttp.send Else
xmlhttp.Open "POST", "https://registro.br/cgi-bin/whois/#lresp", False
xmlhttp.send("qr="&Replace(endereco & dominio, " .",".")) End If
Olha eu conseguir fazer este
Verifica dominios quero adptar com os checkbox para depois disponibilizar.
<% Server.ScriptTimeout = 99999999 Dim dominio Dim endereco Dim xmlhttp Dim Resultado Dim arrayDominios Dim verificarDominios Dim contador Dim detalhe Dim dominiosInternic Dim dominiosInt Dim dominiosRegistroBr If request("endereco")<>"" then endereco= Request("endereco") dominio=Request("dominio") dominiosRegistroBr = ""&dominio&"" verificarDominios = Replace(dominio, ",", ",") arrayDominios = Split(verificarDominios, ",") Response.ContentType = "text/html" For contador = Lbound(arrayDominios) To Ubound(arrayDominios) dominio = arrayDominios(contador) detalhe = "" If dominio <> "" Then Set xmlhttp = Server.CreateObject("Microsoft.XMLHTTP") If InStr(1, dominiosRegistroBr, ",") > 0 Then xmlhttp.Open "GET", "http://reports.internic.net/cgi/whois?whois_nic="&Replace(endereco & dominio, " .",".")& "&type=domain", False xmlhttp.send Else xmlhttp.Open "POST", "https://registro.br/cgi-bin/whois/#lresp", False xmlhttp.send("qr=" &Replace(endereco & dominio, " .",".")) End If Resultado = BinaryToString(xmlhttp.responseBody) If InStr(1, dominiosRegistroBr, ",") > 0 Then If InStr(1, Resultado, "No match for domain", vbTextCompare) > 0 Or InStr(1, Resultado, "No match for registrar", vbTextCompare) > 0 or not InStr(1, Resultado, "Domain Name", vbTextCompare) > 0 Or InStr(1, Resultado, "No match for registrar", vbTextCompare) > 0 Then If saida <> "" Then saida = saida & "" saida = saida & "<tr><td width=""3""><input type=""checkbox"" value=""" &Replace(endereco & dominio, " .",".")& """ /></td><td width=""85%""><strong>" &Replace(endereco & dominio, " .",".")& "</strong></td><td width=""15%""><img src=""../images/disponivel.png"" align=""absmiddle"" border=""0"" width=""10"" height=""10""> <font color=""blue"">Disponivel</font></td></tr>" Else If saida <> "" Then saida = saida & "" saida = saida & "<tr><td colspan=""3""><div style=""display:none;"" id=""d"&varCont&"_mais_menos""></div><div style=""display:none;"" id=""periodo_"&varCont&"""><table width=""100%""><tr><td>"& detalhe & "</td></tr></table></div></td></tr>" saida = saida & "<tr><td width=""3""><input type=""checkbox"" value=""" &Replace(endereco & dominio, " .",".")& """ disabled/></td><td width=""85%""><a href=""http://www."&Replace(endereco & dominio, " .",".")&""" target=""_blank""><font color=""red"">" &Replace(endereco & dominio, " .",".")& "</font></a></span></td><td width=""15%""><a class=""rteimage"" onclick=""window.open('Checker_detalhes.asp?dominio="&endereco&"&pont="&Replace(dominio, " .",".")&"','','scrollbars=yes,top=10,left=10,width=300,height=350');"" class=""hiperlink""><img src=""../images/mais.gif"" name=""d"&varCont&"_mais_menos"" align=""absmiddle"" border=""0"" width=""10"" height=""10""> <font color=""red"">Indisponivel</font></a></td></tr>" If InStr(1, Resultado, "NOT AUTHORITATIVE", vbTextCompare) > 0 and InStr(1, Resultado, "No match for domain", vbTextCompare) > 0 and InStr(1, Resultado, "No match for registrar", vbTextCompare) > 0 Then ElseIf InStr(1, Resultado, "Domain Name:", vbTextCompare) > 0 or InStr(1, Resultado, "Name Server:", vbTextCompare) > 0 Then posInicioDetalhe = InStr(1, Resultado, "Domain Name:", vbTextCompare) If posInicioDetalhe > 0 Then posFimDetalhe = InStr(1, Mid(Resultado, posInicioDetalhe), "Expiration Date", vbTextCompare) + 29 End If If posFimDetalhe > 0 or posInicioDetalhe > 0 Then detalhe = Mid(Resultado, posInicioDetalhe, posFimDetalhe) detalhe = Replace(detalhe, "Registrar:", "<br />Registrar:") detalhe = Replace(detalhe, "Whois Server:", "<br />Whois Server:") detalhe = Replace(detalhe, "URL:", "<br />URL:") detalhe = Replace(detalhe, "Name Server:", "<br />Name Server:") detalhe = Replace(detalhe, "Status:", "<br /> Status:") detalhe = Replace(detalhe, "Updated Date:", "<br />Updated Date:") detalhe = Replace(detalhe, "Creation Date:", "<br />Creation Date:") detalhe = Replace(detalhe, "Expiration Date:", "<br />Expiration Date:") end if end if end if '============================== else If InStr(1, Resultado, "Domínio inexistente", vbTextCompare) > 0 Then If saida <> "" Then saida = saida & "" saida = saida & "<tr><td width=""3""><input type=""checkbox"" value=""" &Replace(endereco & dominio, " .",".")& """ /></td><td width=""75%""><strong>" &Replace(endereco & dominio, " .",".")& "</strong></td><td width=""15%""><img src=""../images/disponivel.png"" align=""absmiddle"" border=""0"" width=""10"" height=""10""> <font color=""blue"">Disponivel</font></td></tr>" ElseIf InStr(1, Resultado, "Sintaxe inválida", vbTextCompare) > 0 Or InStr(1, Resultado, "ASN inexistente", vbTextCompare) > 0 Then If saida <> "" Then saida = saida & "" saida = saida & "<tr><td width=""3""></td><td><span style=""color:red;"">" &Replace(endereco & dominio, " .",".")& "</span></td><td>URL invalida</td></tr>" ElseIf InStr(1, Resultado, "Consulta inválida", vbTextCompare) > 0 Then If saida <> "" Then saida = saida & "" saida = saida & "<tr><td width=""3""></td><td><span style=""color:red;"">" &Replace(endereco & dominio, " .",".")& "</span></td><td>Consulta invalida</td></tr>" ElseIf InStr(1, Resultado, "ID entidade:", vbTextCompare) > 0 And InStr(1, Resultado, "servidor DNS:", vbTextCompare) > 0 Then posInicioDetalhe = InStr(1, Resultado, "domínio:", vbTextCompare) If posInicioDetalhe > 0 Then posFimDetalhe = InStrRev(Mid(Resultado, posInicioDetalhe), "alterado") + 25 End If If posFimDetalhe > 0 And posInicioDetalhe > 0 Then detalhe = Mid(Resultado, posInicioDetalhe, posFimDetalhe) ' detalhe = limparHtml(detalhe) detalhe = Replace(detalhe, "entidade:", "<br />entidade:", 1, -1, 1) detalhe = Replace(detalhe, "documento:", "<br />documento:", 1, -1, 1) detalhe = Replace(detalhe, "responsável:", "<br />responsável:", 1, -1, 1) detalhe = Replace(detalhe, "país:", "<br />país:", 1, -1, 1) detalhe = Replace(detalhe, "ID entidade:", "<br />ID entidade:", 1, -1, 1) detalhe = Replace(detalhe, "ID admin:", "<br />ID admin:", 1, -1, 1) detalhe = Replace(detalhe, "ID técnico:", "<br />ID técnico:", 1, -1, 1) detalhe = Replace(detalhe, "ID cobrança:", "<br />ID cobrança:", 1, -1, 1) detalhe = Replace(detalhe, "servidor DNS:", "<br />servidor DNS:", 1, -1, 1) detalhe = Replace(detalhe, "status DNS:", "<br />status DNS:", 1, -1, 1) detalhe = Replace(detalhe, "último AA:", "<br />último AA:", 1, -1, 1) detalhe = Replace(detalhe, "criado:", "<br />criado:", 1, -1, 1) detalhe = Replace(detalhe, "expiração:", "<br />expiração:", 1, -1, 1) detalhe = Replace(detalhe, "alterado:", "<br />alterado:", 1, -1, 1) detalhe = Replace(detalhe, "status:", "<br />status:", 1, -1, 1) detalhe = Replace(detalhe, "ID:", "<br />ID:", 1, -1, 1) detalhe = Replace(detalhe, "e-mail:", "<br />e-mail:", 1, -1, 1) detalhe = Replace(detalhe, "criado:", "<br />criado:", 1, -1, 1) detalhe = Replace(detalhe, "alterado:", "<br />alterado:", 1, -1, 1) End If If saida <> "" Then saida = saida & "" saida = saida & "<tr><td colspan=""3""><div style=""display:none;"" id=""d"&varCont&"_mais_menos""></div><div style=""display:none;"" id=""periodo_"&varCont&"""><table width=""100%""><tr><td>"& detalhe & "</td></tr></table></div></td></tr>" saida = saida & "<tr><td width=""3""><input type=""checkbox"" value=""" &Replace(endereco & dominio, " .",".")& """ disabled/></td><td width=""85%""><a href=""http://www."&Replace(endereco & dominio, " .",".")&""" target=""_blank""><font color=""red"">" &Replace(endereco & dominio, " .",".")& "</font></a></span></td><td width=""15%""><a class=""rteimage"" onclick=""window.open('Checker_detalhes.asp?dominio="&endereco&"&pont="&Replace(dominio, " .",".")&"','','scrollbars=yes,top=10,left=10,width=300,height=350');"" class=""hiperlink""><img src=""../images/mais.gif"" name=""d"&varCont&"_mais_menos"" align=""absmiddle"" border=""0"" width=""10"" height=""10""> <font color=""red"">Indisponivel</font></a></td></tr>" End If end if end if Next end if Public Function BinaryToString(xBinary) Dim Binary Dim RS, LBinary If VarType(xBinary)=8 Then Binary = MultiByteToBinary(xBinary) Else Binary = xBinary Const adLongVarChar = 201 Set RS = CreateObject("ADODB.Recordset") LBinary = LenB(Binary) If LBinary>0 Then RS.Fields.Append "mBinary", adLongVarChar, LBinary RS.Open RS.AddNew RS("mBinary").AppendChunk Binary RS.Update BinaryToString = RS("mBinary") Else BinaryToString = "" End If Set RS = Nothing End Function Public Function MultiByteToBinary(MultiByte) Dim RS, LMultiByte, Binary Const adLongVarBinary = 205 Set RS = CreateObject("ADODB.Recordset") LMultiByte = LenB(MultiByte) If LMultiByte>0 Then RS.Fields.Append "mBinary", adLongVarBinary, LMultiByte RS.Open RS.AddNew RS("mBinary").AppendChunk MultiByte & ChrB(0) RS.Update Binary = RS("mBinary").GetChunk(LMultiByte) End If Set RS = Nothing MultiByteToBinary = Binary End Function %> <html> <head> <title>Registro de dominios</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="css/show_ads.css" rel="stylesheet" type="text/css" /> <link href="css/generalhs.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="prototype.js"></script> <script type="text/javascript"> function Verifica(event){ var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; var caract = new RegExp(/[a-z0-9-áéíóúç\b\.-]+$/i); var caract = caract.test(String.fromCharCode(keyCode)); if(!caract){ // alert("Não digite a extensão do domínio neste campo.\nSelecione a extensão na caixa ao lado.\n\nEm caso de subdomínios, digite apenas a parte principal.\n\nExemplo 1 - Domínio desejado - www.adok.com.br\nDigite apenas 'adok' no campo.\n\nExemplo 2 - Domínio desejado (com subdomínio) - www.suporte.adok.com.br\nDigite apenas 'adok' no campo."); keyCode=0; return false; } } function bloqueia(msg){ if(event.button != 1)alert('Acesso negado'); } function GetDominio(){ if (document.formDom.endereco.value.length ==""){ alert("Por favor, digite um nome para seu domínio !"); document.formDom.endereco.focus(); return false; } Element.update("content","<span class='txt2'><br /><br />Aguarde, verificando disponibilidade...</span><br /><br /><img src='images/iga_com_br.gif' onmousedown='bloqueia();' width='146' height='12'>"); var myAjax = new Ajax.Updater({success: 'content'}, 'Dominios.asp?dom=<%=request("dominio")%>', { method: 'get', parameters: 'dom='+document.formDom.dominio.value + document.formDom.dominio.value}); } <!-- var imgmais = new Image(); var imgmenos = new Image(); imgmais.src = "../images/mais.gif" imgmenos.src = "../images/menos.gif" function mostrar_mais(quem,mm){ var mmimg = eval(mm+"_mais_menos") if (quem.style.display == "none"){ quem.style.display = "" mmimg.src = imgmenos.src }else{ quem.style.display = "none" mmimg.src = imgmais.src } } //--> </script> </head> <body class="tabela01"> <form id="formDom" name="formDom" method="post" onSubmit="return GetDominio(this);"> <table bordercolor="#336699" align="center" border="0"> <tr><td><img src="images/igad_br.gif" alt="Registro de Domínios" width="495" height="21" /></td></tr> <tr><td width="495"> Para o seu negócio ter sucesso, é fundamental marcar presença na Web. Possuir um site personalizado e um endereço de e-mail próprio (seunome@seunome.com.br) é o primeiro passo. <table border="0" align="center" width="500"> <tr><td align="right" class="txt" width="100%"> <fieldset style="width: 495;" class="fildweb" > <legend><strong>Verifique se o domínio que você quer registrar está disponível </strong></legend> <table border="0" align="center" width="100%" > <tr><td align="right" class="txt">Domínio:<strong> www.</strong> </td> <td><label> <input name="endereco" type="text" class="camp" id="endereco" size="20" maxlength="59" value="<%=request("endereco")%>" onkeypress="return Verifica(event);"> </label> </td> </tr> <tr><td colspan="3"> <input type="checkbox" value=".com.br"name="dominio">.com.br <input type="checkbox" value=".adm.br"name="dominio">.adm.br <input type="checkbox" value=".br"name="dominio">.br <input type="checkbox" value=".net.br"name="dominio">.net.br <input type="checkbox" value=".org.br"name="dominio">.org.br <input type="checkbox" value=".gov.br"name="dominio">.gov.br <input type="checkbox" value=".tv.br"name="dominio">.tv.br<br> <input type="checkbox" value=".com"name="dominio">.com <input type="checkbox" value=".net"name="dominio">.net <input type="checkbox" value=".org"name="dominio">.org <input type="checkbox" value=".info"name="dominio">.info </td></tr> <td><td><input name="Button" type="submit" class="bot" value="Procurar" /></td></tr> </table> </fieldset> </td></tr> </table> <div id="d1_mais_menos" align="center"> <div id="content" align="center"> <table border="1" align="center" cellpadding="1" cellspacing="1" width="100%"> <tr><td align="center" ><b>X</b></td><td align="center" width="75%"><b>Dominios</b></td><td align="center" width="20%"><b>Status</b></td></tr> <tr><td colspan="4" width="100%"> <div align="center"> <%=saida%> </div> </td></tr> </table> </div> </div> </strong>Extensões disponíveis: <font color="#0000FF">.com.br, .adm.br, .br, .net.br, .org.br, .gov.br, .tv.br,</font><br /> </strong>Extensões disponíveis: <font color="#0000FF">.com, .net</font><br /> </td></tr></table> </form> </body> </html>Link para o comentário
Compartilhar em outros sites
2 respostass a esta questão
Posts Recomendados
Participe da discussão
Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.