Vérificateur de nom de domain

wizard512 Messages postés 459 Date d'inscription dimanche 9 janvier 2005 Statut Membre Dernière intervention 11 mai 2013 - 11 juil. 2005 à 13:54
malik7934 Messages postés 1154 Date d'inscription mardi 9 septembre 2003 Statut Membre Dernière intervention 15 août 2009 - 11 juil. 2005 à 20:18
bonjours, j'ai trouver sur internet un script qui vérifie les nom de domain mais se script ne marche pas (déja que j'ai du réparer quelques erreur) si quelqu'un pouvais m'aider svp (ou si il pourrai m'indiquer un endroit ou trouver un script similère)

le script :

<?php


header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");


?>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">


<html>
<head>
<title>Nom de domaine</title>


<?
if (isset($submit)) {


switch ($endfix) {
case '.de':$id=1;break;
case '.com':$id=2;break;
case '.net':$id=3;break;
case '.org':$id=4;break;
case '.lu':$id=5;break;
case '.fr':$id=6;break;
case '.be':$id=7;break;
case '.at':$id=8;break;
case '.it':$id=9;break;
case '.no':$id=10;break;
case '.ac':$id=11;break;
case '.dk':$id=12;break;
case '.cz':$id=13;break;
case '.is':$id=14;break;
case '.sk':$id=15;break;
case '.li':$id=16;break;
case '.ch':$id=17;break;
case '.eu.org':$id=18;break;
case '.sk':$id=19;break;
case '.lt':$id=20;break;
case '.hu':$id=21;break;


default:echo("Fehler !\n");break;
}


$domain=($domainname."".$endfix."");


if ($id==1) {
$WhoIsServer="whois.ripe.net";
$fp = fsockopen ("$WhoIsServer", 43, $errnr, $errstr);
set_socket_blocking($fp,0);
fputs($fp, "$domain\n");
while (!feof($fp)) {
$result = fgets($fp, 2048);
if (substr("$result" ,2, 16) == "No entries found") {
printf("\");
printf("Le nom de domaine $domain est libre!

");
}


else if (substr("$result" ,0, 7) == "domain:") {
printf ("\");
printf (\"Le nom de domaine $domain n est pas libre

");
printf ("Voulez vous avoir des information a propos de ce domaine? Oui / Non

");
}
}
fclose($fp);
}


else if ($id==5) {


$WhoIsServer="whois.restena.lu";
$fp = fsockopen ("$WhoIsServer", 43, $errnr, $errstr);
set_socket_blocking($fp, 0);
fputs($fp, "$domain\n");
while (!feof($fp)) {
$result = fgets($fp, 2048);


if (substr("$result" ,2, 16) == "No entries found") {
printf("\");
printf("Le nom de domaine $domain est libre!

");
}
else if (substr("$result" ,0, 11) == "domainname:") {
printf ("\");
printf (\"Le nom de domaine $domain n est pas libre

");
printf ("Voulez vous avoir des information a propos de ce domaine? Oui / Non

");
}
}
fclose($fp);
}


// s.o.


else if ($id==6) {
$WhoIsServer="whois.ripe.net";
$fp = fsockopen ("$WhoIsServer", 43, $errnr, $errstr);
set_socket_blocking($fp,0);
fputs($fp, "$domain\n");
while (!feof($fp)) {
$result = fgets($fp, 2048);
if (substr("$result" ,2, 16) == "No entries found") {
printf("\");
printf("Le nom de domaine $domain est libre!

");
}


else if (substr("$result" ,0, 7) == "domain:") {
printf ("\");
printf (\"Le nom de domaine $domain n est pas libre

");
printf ("Voulez vous avoir des information a propos de ce domaine? Oui / Non

");
}
}
fclose($fp);
}


//s .o.


else if ($id==7) {
$WhoIsServer="whois.ripe.net";
$fp = fsockopen ("$WhoIsServer", 43, $errnr, $errstr);
set_socket_blocking($fp,0);
fputs($fp, "$domain\n");
while (!feof($fp)) {
$result = fgets($fp, 2048);
if (substr("$result" ,2, 16) == "No entries found") {
printf("\");
printf("Le nom de domaine $domain est libre!

");
}


else if (substr("$result" ,0, 7) == "domain:") {
printf ("\");
printf (\"Le nom de domaine $domain n est pas libre

");
printf ("Voulez vous avoir des information a propos de ce domaine? Oui / Non

");
}
}
fclose($fp);
}


//s .o.



else if ($id==8) {
$WhoIsServer="whois.ripe.net";
$fp = fsockopen ("$WhoIsServer", 43, $errnr, $errstr);
set_socket_blocking($fp,0);
fputs($fp, "$domain\n");
while (!feof($fp)) {
$result = fgets($fp, 2048);
if (substr("$result" ,2, 16) == "No entries found") {
printf("\");
printf("Le nom de domaine $domain est libre!

");
}


else if (substr("$result" ,0, 7) == "domain:") {
printf ("\");
printf (\"Le nom de domaine $domain n est pas libre

");
printf ("Voulez vous avoir des information a propos de ce domaine? Oui / Non

");
}
}
fclose($fp);
}


//s .o.


else if ($id==9) {
$WhoIsServer="whois.ripe.net";
$fp = fsockopen ("$WhoIsServer", 43, $errnr, $errstr);
set_socket_blocking($fp,0);
fputs($fp, "$domain\n");
while (!feof($fp)) {
$result = fgets($fp, 2048);
if (substr("$result" ,2, 16) == "No entries found") {
printf("\");
printf("Le nom de domaine $domain est libre!

");
}


else if (substr("$result" ,0, 7) == "domain:") {
printf ("\");
printf (\"Le nom de domaine $domain n est pas libre

");
printf ("Voulez vous avoir des information a propos de ce domaine? Oui / Non

");
}
}
fclose($fp);
}


//s .o.


else if ($id==10) {
$WhoIsServer="whois.ripe.net";
$fp = fsockopen ("$WhoIsServer", 43, $errnr, $errstr);
set_socket_blocking($fp,0);
fputs($fp, "$domain\n");
while (!feof($fp)) {
$result = fgets($fp, 2048);
if (substr("$result" ,2, 16) == "No entries found") {
printf("\");
printf("Le nom de domaine $domain est libre!

");
}


else if (substr("$result" ,0, 7) == "domain:") {
printf ("\");
printf (\"Le nom de domaine $domain n est pas libre

");
printf ("Voulez vous avoir des information a propos de ce domaine? Oui / Non

");
}
}
fclose($fp);
}


//s .o.


else if ($id==11) {
$WhoIsServer="whois.nic.ac";
$fp = fsockopen ("$WhoIsServer", 43, $errnr, $errstr);
set_socket_blocking($fp,0);
fputs($fp, "$domain\n");
while (!feof($fp)) {
$result = fgets($fp, 2048);
if (substr("$result" ,0, 12) == "No match for") {
printf("\");
printf("Le nom de domaine $domain est libre!

");
}


else if (substr("$result" ,0, 6) == "Domain") {
printf ("\");
printf (\"Le nom de domaine $domain n est pas libre

");
printf ("Voulez vous avoir des information a propos de ce domaine? Oui / Non

");
}
}
fclose($fp);
}


//s .o.
else if ($id==12) {
$WhoIsServer="whois.ripe.net";
$fp = fsockopen ("$WhoIsServer", 43, $errnr, $errstr);
set_socket_blocking($fp,0);
fputs($fp, "$domain\n");
while (!feof($fp)) {
$result = fgets($fp, 2048);
if (substr("$result" ,2, 16) == "No entries found") {
printf("\");
printf("Le nom de domaine $domain est libre!

");
}


else if (substr("$result" ,0, 7) == "domain:") {
printf ("\");
printf (\"Le nom de domaine $domain n est pas libre

");
printf ("Voulez vous avoir des information a propos de ce domaine? Oui / Non

");
}
}
fclose($fp);
}


//s .o.
else if ($id==13) {
$WhoIsServer="whois.ripe.net";
$fp = fsockopen ("$WhoIsServer", 43, $errnr, $errstr);
set_socket_blocking($fp,0);
fputs($fp, "$domain\n");
while (!feof($fp)) {
$result = fgets($fp, 2048);
if (substr("$result" ,2, 16) == "No entries found") {
printf("\");
printf("Le nom de domaine $domain est libre!

");
}


else if (substr("$result" ,0, 7) == "domain:") {
printf ("\");
printf (\"Le nom de domaine $domain n est pas libre

");
printf ("Voulez vous avoir des information a propos de ce domaine? Oui / Non

");
}
}
fclose($fp);
}


//s .o.
else if ($id==14) {
$WhoIsServer="whois.ripe.net";
$fp = fsockopen ("$WhoIsServer", 43, $errnr, $errstr);
set_socket_blocking($fp,0);
fputs($fp, "$domain\n");
while (!feof($fp)) {
$result = fgets($fp, 2048);
if (substr("$result" ,2, 16) == "No entries found") {
printf("\");
printf("Le nom de domaine $domain est libre!

");
}


else if (substr("$result" ,0, 7) == "domain:") {
printf ("\");
printf (\"Le nom de domaine $domain n est pas libre

");
printf ("Voulez vous avoir des information a propos de ce domaine? Oui / Non

");
}
}
fclose($fp);
}


//s .o.
else if ($id==15) {
$WhoIsServer="whois.ripe.net";
$fp = fsockopen ("$WhoIsServer", 43, $errnr, $errstr);
set_socket_blocking($fp,0);
fputs($fp, "$domain\n");
while (!feof($fp)) {
$result = fgets($fp, 2048);
if (substr("$result" ,2, 16) == "No entries found") {
printf("\");
printf("Le nom de domaine $domain est libre!

");
}


else if (substr("$result" ,0, 7) == "domain:") {
printf ("\");
printf (\"Le nom de domaine $domain n est pas libre

");
printf ("Voulez vous avoir des information a propos de ce domaine? Oui / Non

");
}
}
fclose($fp);
}


//s .o.


else if ($id==16) {
$WhoIsServer="whois.ripe.net";
$fp = fsockopen ("$WhoIsServer", 43, $errnr, $errstr);
set_socket_blocking($fp,0);
fputs($fp, "$domain\n");
while (!feof($fp)) {
$result = fgets($fp, 2048);
if (substr("$result" ,0, 16) == "No entries found") {
printf("\");
printf("Le nom de domaine $domain est libre!

");
}


else if (substr("$result" ,0, 7) == "Domain ") {
printf ("\");
printf (\"Le nom de domaine $domain n est pas libre

");
printf ("Voulez vous avoir des information a propos de ce domaine? Oui / Non

");
}
}
fclose($fp);
}


//s .o.
else if ($id==17) {
$WhoIsServer="whois.ripe.net";
$fp = fsockopen ("$WhoIsServer", 43, $errnr, $errstr);
set_socket_blocking($fp,0);
fputs($fp, "$domain\n");
while (!feof($fp)) {
$result = fgets($fp, 2048);
if (substr("$result" ,0, 16) == "No entries found") {
printf("\");
printf("Le nom de domaine $domain est libre!

");
}


else if (substr("$result" ,0, 7) == "Domain ") {
printf ("\");
printf (\"Le nom de domaine $domain n est pas libre

");
printf ("Voulez vous avoir des information a propos de ce domaine? Oui / Non

");
}
}
fclose($fp);
}


//s .o.
else if ($id==18) {
$WhoIsServer="whois.eu.org";
$fp = fsockopen ("$WhoIsServer", 43, $errnr, $errstr);
set_socket_blocking($fp,0);
fputs($fp, "$domain\n");
while (!feof($fp)) {
$result = fgets($fp, 2048);
if (substr("$result" ,0, 16) == "No entries found") {
printf("\");
printf("Le nom de domaine $domain est libre!

");
}


else if (substr("$result" ,0, 7) == "domain:") {
printf ("\");
printf (\"Le nom de domaine $domain n est pas libre

");
printf ("Voulez vous avoir des information a propos de ce domaine? Oui / Non

");
}
}
fclose($fp);
}


//s .o.
else if ($id==19) {
$WhoIsServer="whois.ripe.net";
$fp = fsockopen ("$WhoIsServer", 43, $errnr, $errstr);
set_socket_blocking($fp,0);
fputs($fp, "$domain\n");
while (!feof($fp)) {
$result = fgets($fp, 2048);
if (substr("$result" ,2, 16) == "No entries found") {
printf("\");
printf("Le nom de domaine $domain est libre!

");
}


else if (substr("$result" ,0, 7) == "domain:") {
printf ("\");
printf (\"Le nom de domaine $domain n est pas libre

");
printf ("Voulez vous avoir des information a propos de ce domaine? Oui / Non

");
}
}
fclose($fp);
}


//s .o.
else if ($id==20) {
$WhoIsServer="whois.ripe.net";
$fp = fsockopen ("$WhoIsServer", 43, $errnr, $errstr);
set_socket_blocking($fp,0);
fputs($fp, "$domain\n");
while (!feof($fp)) {
$result = fgets($fp, 2048);
if (substr("$result" ,2, 16) == "No entries found") {
printf("\");
printf("Le nom de domaine $domain est libre!

");
}


else if (substr("$result" ,0, 7) == "domain:") {
printf ("\");
printf (\"Le nom de domaine $domain n est pas libre

");
printf ("Voulez vous avoir des information a propos de ce domaine? Oui / Non

");
}
}
fclose($fp);
}


//s .o.


else if ($id==21) {
$WhoIsServer="whois.ripe.net";
$fp = fsockopen ("$WhoIsServer", 43, $errnr, $errstr);
set_socket_blocking($fp,0);
fputs($fp, "$domain\n");
while (!feof($fp)) {
$result = fgets($fp, 2048);
if (substr("$result" ,2, 16) == "No entries found") {
printf("\");
printf("Le nom de domaine $domain est libre!

");
}


else if (substr("$result" ,0, 7) == "domain:") {
printf ("\");
printf (\"Le nom de domaine $domain n est pas libre

");
printf ("Voulez vous avoir des information a propos de ce domaine? Oui / Non

");
}
}
fclose($fp);
}


//s .o.



else if ($id==2||3||4) {


$fp = fsockopen("whois.crsnic.net", 43, $errno, $errstr);
set_socket_blocking($fp, 0);
fputs($fp, "$domain\n");
while (!feof($fp)) {
$result = trim(fgets($fp, 2048));
if (substr($result,0, 8) == "No match"){
printf("\");
printf("Le nom de domaine $domain est libre!

");
}
else if (substr($result, 0, 13) == "Whois Server:"){
$WhoIsServer = trim(ereg_replace("Whois Server:"," ",$result));
printf ("\");
printf (\"Le nom de domaine $domain n est pas libre

");
printf ("Voulez vous avoir des information a propos de ce domaine? Oui / Non

");


}
}
fclose($fp);
}


}


function showtime($domain, $WhoIsServer) {if ((empty($domain) false) && (empty($WhoIsServer) false)) {
$fps = fsockopen ("$WhoIsServer", 43, $errno, $errstr)
or die(printf("Probleme avec le serveur Whois.\n"));
set_socket_blocking($fps, 0);
fputs($fps, "$domain\n");
echo "";
while (!feof($fps)) {
$result = fgets($fps, 2048);
echo "$result";
}
echo "

";
fclose($fps);
}
else echo("Impossible d'affiche la date.\n");


}


if(isset($_GET['actio']))
{


$actio = $_GET['actio'];
if($actio) {
switch ($actio) {
case show:
showtime($domain, $WhoIsServer);
break;
default: echo ("Probleme dans Switch!");
break;
}


}
}
?>
</head>




Verification de nom de domaine:,
<form action="index.php3" method="POST" target="_self">www. &nbsp;&nbsp;&nbsp;<select name="endfix" size="1">
<option name="com" value=".com">.com
<option name="net" value=".net">.net
<option name="org" value=".org">.org
<option name="fr" value=".fr">.fr
<option name="de" value=".de">.de
<option name="ac" value=".ac">.ac
<option name="at" value=".at">.at
<option name="be" value=".be">.be
<option name="ch" value=".ch">.ch
<option name="cz" value=".cz">.cz
<option name="dk" value=".dk">.dk
<option name="eu.org" value=".eu.org">.eu.org
<option name="it" value=".it">.it
<option name="is" value=".is">.is
<option name="hu" value=".hu">.hu
<option name="li" value=".li">.li
<option name="lt" value=".lt">.lt
<option name="lu" value=".lu">.lu
<option name="no" value=".no">.no
<option name="sk" value=".sk">.sk
</select>, </td>
, </form>



</html>

2 réponses

cs_Anthomicro Messages postés 9433 Date d'inscription mardi 9 octobre 2001 Statut Membre Dernière intervention 13 avril 2007 8
11 juil. 2005 à 14:23
Salut,



t'as pas trouvé plus court comme script ? c'est un peu long pour qu'on t'aide non ?

<hr size="2" width="100%">




<li>Entraide, dépannage et vulgarisation informatique: Mon site de vulgarisation informatique</li>
0
malik7934 Messages postés 1154 Date d'inscription mardi 9 septembre 2003 Statut Membre Dernière intervention 15 août 2009 17
11 juil. 2005 à 20:18
Hehe... c'est vrai que c'est un peu long...



Aucune de tes variables n'a de valeurs! Il manque $submit $_POST['submit']; $endfix $_POST['endfix'] et $domainname =
$_POST['domainname']!



Je sais pas où t'es allé chercher ce script, mais bon...
0
Rejoignez-nous