Jump to content


Photo

Consulta De Dominio


  • Faça o login para participar
5 replies to this topic

#1 Mordechai

Mordechai

    Novato no fórum

  • Usuários
  • 5 posts
  • Sexo:Não informado
  • Localidade:Campinas - SP
  • Interesses:Fireworks, Hospedagem, Virtuemart, Web, Joomla

Posted 20/10/2008, 21:51

Olá a Todos, Sou NOVATO aqui no forum e Preciso de uma ajuda em um Script PHP de consulta a Dominios.
No meu caso não está fazendo consulta para os .com.br (Brasil)
Se alguém puder ajudar...se precisar posto server.lst (arquivo com lista de servidores)
Quem quiser testar pode acessar www.kjon.com.br/whois , em extensão .com.br não retorna resultado. somente nas outras extensões.

Veja o Script:

<?php/************************************************** Max's Whois** Version: 1.0* Date: 2007-11-28*****************************************************/class maxWhois{var $serverList;var $tr = 0;function maxWhois(){$this->serverList[0]['top'] = 'com.br';$this->serverList[0]['server'] = 'whois.registro.br';$this->serverList[0]['response'] = 'No match for';$this->serverList[0]['check'] = false;$this->serverList[9]['top'] = 'com';$this->serverList[9]['server'] = 'whois.crsnic.net';$this->serverList[9]['response'] = 'No match for';$this->serverList[9]['check'] = true;$this->serverList[1]['top'] = 'net';$this->serverList[1]['server'] = 'whois.crsnic.net';$this->serverList[1]['response'] = 'No match for';$this->serverList[1]['check'] = false;$this->serverList[2]['top'] = 'org';$this->serverList[2]['server'] = 'whois.publicinterestregistry.net';$this->serverList[2]['response'] = 'NOT FOUND';$this->serverList[2]['check'] = false;$this->serverList[3]['top'] = 'info';$this->serverList[3]['server'] = 'whois.afilias.net';$this->serverList[3]['response'] = 'NOT FOUND';$this->serverList[3]['check'] = false;$this->serverList[4]['top'] = 'name';$this->serverList[4]['server'] = 'whois.nic.name';$this->serverList[4]['response'] = 'No match';$this->serverList[4]['check'] = false;$this->serverList[5]['top'] = 'us';$this->serverList[5]['server'] = 'whois.nic.us';$this->serverList[5]['response'] = 'Not found:';$this->serverList[5]['check'] = false;$this->serverList[6]['top'] = 'biz';$this->serverList[6]['server'] = 'whois.nic.biz';$this->serverList[6]['response'] = 'Not found';$this->serverList[6]['check'] = false;$this->serverList[7]['top'] = 'ca';$this->serverList[7]['server'] = 'whois.cira.ca';$this->serverList[7]['response'] = 'No match';$this->serverList[7]['check'] = false;$this->serverList[8]['top'] = 'tv';$this->serverList[8]['server'] = 'whois.internic.net';$this->serverList[8]['response'] = 'No match for';$this->serverList[8]['check'] = false;}function showHeader(){?><div id="container"><div id="header"><div id="header_left"></div><div id="header_main">BRLOGIN</div><div id="header_right"></div></div><div id="content"><?php}function showWhoisForm(){?><form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" ><table class="dtable2"><tr><th colspan="5">Entre com o NOME de Dominio:</th></tr><tr><td colspan="5"><center>www.<input name="domain" type="text" size="35" /></center></td></tr><tr><th colspan="5">Selecinone a extensao:</th></tr><tr><?php$i = 0;foreach ($this->serverList as $value) {if ($value['check'] == true) $checked=" checked ";else $checked = " ";echo '<td><input type="checkbox" name="top_'.$value['top'].'"'.$checked.'/>.'.$value['top'].'</td>';$i++; if ($i > 4) {$i = 0;echo '</tr><tr>';}}?> </tr></table><center><input type="submit" name="submitBtn" class="sbtn" value="Consulte" /></center></form><?php}function showFooter(){?></div><div id="footer"><a href="http://www.brlogin.com.br" target="_blank">Brlogin - Hospedagem de Site</a></div></div><?php}function processWhois(){$this->showHeader();if (!isset($_POST['submitBtn'])){$this->showWhoisForm();} else {$domainName = (isset($_POST['domain'])) ? $_POST['domain'] : '';for ($i = 0; $i < sizeof($this->serverList); $i++) {$actTop = "top_".$this->serverList[$i]['top'];$this->serverList[$i]['check'] = isset($_POST[$actTop]) ? true : false;}// Check domains only if the base name is big enoughif (strlen($domainName)>2){echo '<table class="dtable">';echo '<tr><th colspan="2">Resultado</th></tr>';for ($i = 0; $i < sizeof($this->serverList); $i++) {if ($this->serverList[$i]['check']){$this->showDomainResult($domainName.".".$this->serverList[$i]['top'],$this->serverList[$i]['server'],$this->serverList[$i]['response']);}}echo '</table>';}$this->showWhoisForm();}$this->showFooter();}function showDomainResult($domain,$server,$findText){if ($this->tr == 0){$this->tr = 1;$class = " class='tr2'";} else {$this->tr = 0;$class = "";}if ($this->checkDomain($domain,$server,$findText)){echo "<tr $class><td>$domain</td><td class='ava'>DISPONIVEL</td></tr>";}else echo "<tr $class><td>$domain</td><td class='tak'>JA REGISTRADO</td></tr>";}function checkDomain($domain,$server,$findText){$con = fsockopen($server, 43);if (!$con) return false;// Send the requested doman namefputs($con, $domain."\r\n");// Read and store the server response$response = ' :';while(!feof($con)) {$response .= fgets($con,128); }// Close the connectionfclose($con);// Check the response stream whether the domain is availableif (strpos($response, $findText)){return true;}else {return false; }}}?>

Grato

Edição feita por: maykel, 21/10/2008, 08:22.
Uso da tag Codebox

Marcos Lima
www.brlogin.com.br
Hospedagem e loja Virtual
www.kjon.com.br
Cajon com esteira

#2 Maykel Esser

Maykel Esser

    Super Veterano

  • Usuários
  • 1536 posts
  • Sexo:Masculino
  • Localidade:Curitiba - PR

Posted 21/10/2008, 08:23

Olá amigo, seja bem-vindo!

Você quer que seu script ignore os .com.br?

Se este post lhe ajudou, ajude o fórum também. Use a reputação de mensagens! add.png


#3 Mordechai

Mordechai

    Novato no fórum

  • Usuários
  • 5 posts
  • Sexo:Não informado
  • Localidade:Campinas - SP
  • Interesses:Fireworks, Hospedagem, Virtuemart, Web, Joomla

Posted 23/10/2008, 11:32

Olá!! Não Não!!

Eu quero que o ".COM.BR" seja encontrado, ou seja quando faz a consulta, não retorna resultado para .com.br,
caso queira testar segue o link www.kjon.com.br/whois , vai perceber que não está fazendo consulta.
Este sistema trabalha com tres arquivos, Um index.html, para a partida o maxwhois, que é o post acima e uma lista de servidores, server.lst.
Creio que a edição feita para consulta no Registro Br esteja errada , penso!!! mas não sou mestre em PHP, por isso preciso ajuda!!
Grato

BOM!! fiz algumas mudanças como segue abaixo , mas ainda sem sucesso,...a consulta para o registr BR (.com.br) não retorna nada... é como se não tivesse encontrado o servidor, e ainda desmarca a opção do Checkbox.

Antes:
$this->serverList[0]['top'] = 'com.br';
$this->serverList[0]['server'] = 'whois.registro.br';
$this->serverList[0]['response'] = 'No match for';
$this->serverList[0]['check'] = false;

Depois:
$this->serverList[0]['top'] = 'com.br';
$this->serverList[0]['server'] = 'whois.nic.br';
$this->serverList[0]['response'] = 'No match';
$this->serverList[0]['check'] = false;

Se alguem puder ajudar!!!
Marcos Lima
www.brlogin.com.br
Hospedagem e loja Virtual
www.kjon.com.br
Cajon com esteira

#4 Mordechai

Mordechai

    Novato no fórum

  • Usuários
  • 5 posts
  • Sexo:Não informado
  • Localidade:Campinas - SP
  • Interesses:Fireworks, Hospedagem, Virtuemart, Web, Joomla

Posted 28/10/2008, 09:57

Olá a Todos!!!!
Se alguém tiver um modelo semalhante a este Script, que faça consulta de Dominios Nacional e Internacional...por favor posta aí prá gente... estou tentando por aqui mas ainda...NNNAAAAAADDDDDAAAAA!!! vamos seguindo...
Como diz o MKA.."Atirei o Pau no gato...mas o gato num morreu"""
Marcos Lima
www.brlogin.com.br
Hospedagem e loja Virtual
www.kjon.com.br
Cajon com esteira

#5 MkA

MkA

    Novato no fórum

  • Usuários
  • 10 posts
  • Sexo:Não informado
  • Localidade:Rio de Janeiro

Posted 28/10/2008, 16:55

Mordechai, já mandei a parada pro seu email, funciona legal... fiz uma modificação nele quando usei para funcionar com o .com.br...

espero que ajude...

Attached Files


Limitações são criadas apenas pela nossa mente.

#6 Mordechai

Mordechai

    Novato no fórum

  • Usuários
  • 5 posts
  • Sexo:Não informado
  • Localidade:Campinas - SP
  • Interesses:Fireworks, Hospedagem, Virtuemart, Web, Joomla

Posted 29/10/2008, 12:32

Beleza...,mas tá dando esta mensagem de erro:
Parse error: syntax error, unexpected '{' in C:\xampp\htdocs\mwhois\index.php on line 65
Pode ser por estar em LOCALHOST!!!! (!!! = interrogação, estou testando um terminal server e infelizmente ele não configura a INTERROGAÇÃO)
No mais Muito obrigado!!!
Marcos Lima
www.brlogin.com.br
Hospedagem e loja Virtual
www.kjon.com.br
Cajon com esteira




1 user(s) are reading this topic

0 membro(s), 1 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq