Verification de validiter d'un nom de domaine

Contenu du snippet

Ce code verifie si le nom de domaine et utiliser ou pas et si il est donne des information sur le proprietaire

Source / Exemple :


<?

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("<table border=1 width=640 align=center><tr>");
                printf("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain est libre!</b></font></td></tr></table><br><br><br><br><br>");
                }

        else if (substr("$result" ,0, 7) == "domain:") {
                printf ("<table border=1 width=640 align=center><tr>");
                printf ("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain n est pas libre</b></font><br><br>");
                printf ("<font face='arial' size='2' color='#4E566B'><b>Voulez vous avoir des information a propos de ce domaine? <a href='$PHP_SELF?actio=show&WhoIsServer=$WhoIsServer&domain=$domain' target='_self'>Oui</a> / <a href='#' target='_self'>Non</a>  </b></font><br><br></td></tr></table><br><br><br><br><br>");
                           }
      }
    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("<table border=1 width=640 align=center><tr>");
                printf("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain est libre!</b></font></td></tr></table><br><br><br><br><br>");
                        }
        else if (substr("$result" ,0, 11) == "domainname:") {
                         printf ("<table border=1 width=640 align=center><tr>");
                printf ("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain n est pas libre</b></font><br><br>");
                printf ("<font face='arial' size='2' color='#4E566B'><b>Voulez vous avoir des information a propos de ce domaine? <a href='$PHP_SELF?actio=show&WhoIsServer=$WhoIsServer&domain=$domain' target='_self'>Oui</a> / <a href='#' target='_self'>Non</a>  </b></font><br><br></td></tr></table><br><br><br><br><br>");
              }
                }
    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("<table border=1 width=640 align=center><tr>");
                printf("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain est libre!</b></font></td></tr></table><br><br><br><br><br>");
                }

        else if (substr("$result" ,0, 7) == "domain:") {
                printf ("<table border=1 width=640 align=center><tr>");
                printf ("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain n est pas libre</b></font><br><br>");
                printf ("<font face='arial' size='2' color='#4E566B'><b>Voulez vous avoir des information a propos de ce domaine? <a href='$PHP_SELF?actio=show&WhoIsServer=$WhoIsServer&domain=$domain' target='_self'>Oui</a> / <a href='#' target='_self'>Non</a>  </b></font><br><br></td></tr></table><br><br><br><br><br>");
                           }
      }
    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("<table border=1 width=640 align=center><tr>");
                printf("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain est libre!</b></font></td></tr></table><br><br><br><br><br>");
                }

        else if (substr("$result" ,0, 7) == "domain:") {
               printf ("<table border=1 width=640 align=center><tr>");
                printf ("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain n est pas libre</b></font><br><br>");
                printf ("<font face='arial' size='2' color='#4E566B'><b>Voulez vous avoir des information a propos de ce domaine? <a href='$PHP_SELF?actio=show&WhoIsServer=$WhoIsServer&domain=$domain' target='_self'>Oui</a> / <a href='#' target='_self'>Non</a>  </b></font><br><br></td></tr></table><br><br><br><br><br>");
                           }
      }
    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("<table border=1 width=640 align=center><tr>");
                printf("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain est libre!</b></font></td></tr></table><br><br><br><br><br>");
                }

        else if (substr("$result" ,0, 7) == "domain:") {
               printf ("<table border=1 width=640 align=center><tr>");
                printf ("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain n est pas libre</b></font><br><br>");
                printf ("<font face='arial' size='2' color='#4E566B'><b>Voulez vous avoir des information a propos de ce domaine? <a href='$PHP_SELF?actio=show&WhoIsServer=$WhoIsServer&domain=$domain' target='_self'>Oui</a> / <a href='#' target='_self'>Non</a>  </b></font><br><br></td></tr></table><br><br><br><br><br>");
                           }
      }
    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("<table border=1 width=640 align=center><tr>");
                printf("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain est libre!</b></font></td></tr></table><br><br><br><br><br>");
                }

        else if (substr("$result" ,0, 7) == "domain:") {
                printf ("<table border=1 width=640 align=center><tr>");
                printf ("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain n est pas libre</b></font><br><br>");
                printf ("<font face='arial' size='2' color='#4E566B'><b>Voulez vous avoir des information a propos de ce domaine? <a href='$PHP_SELF?actio=show&WhoIsServer=$WhoIsServer&domain=$domain' target='_self'>Oui</a> / <a href='#' target='_self'>Non</a>  </b></font><br><br></td></tr></table><br><br><br><br><br>");
                           }
      }
    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("<table border=1 width=640 align=center><tr>");
                printf("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain est libre!</b></font></td></tr></table><br><br><br><br><br>");
                }

        else if (substr("$result" ,0, 7) == "domain:") {
                printf ("<table border=1 width=640 align=center><tr>");
                printf ("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain n est pas libre</b></font><br><br>");
                printf ("<font face='arial' size='2' color='#4E566B'><b>Voulez vous avoir des information a propos de ce domaine? <a href='$PHP_SELF?actio=show&WhoIsServer=$WhoIsServer&domain=$domain' target='_self'>Oui</a> / <a href='#' target='_self'>Non</a>  </b></font><br><br></td></tr></table><br><br><br><br><br>");
                           }
      }
    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("<table border=1 width=640 align=center><tr>");
                printf("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain est libre!</b></font></td></tr></table><br><br><br><br><br>");
                }

        else if (substr("$result" ,0, 6) == "Domain") {
                printf ("<table border=1 width=640 align=center><tr>");
                printf ("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain n est pas libre</b></font><br><br>");
                printf ("<font face='arial' size='2' color='#4E566B'><b>Voulez vous avoir des information a propos de ce domaine? <a href='$PHP_SELF?actio=show&WhoIsServer=$WhoIsServer&domain=$domain' target='_self'>Oui</a> / <a href='#' target='_self'>Non</a>  </b></font><br><br></td></tr></table><br><br><br><br><br>");
                            }
      }
    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("<table border=1 width=640 align=center><tr>");
                printf("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain est libre!</b></font></td></tr></table><br><br><br><br><br>");
                }

        else if (substr("$result" ,0, 7) == "domain:") {
                printf ("<table border=1 width=640 align=center><tr>");
                printf ("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain n est pas libre</b></font><br><br>");
                printf ("<font face='arial' size='2' color='#4E566B'><b>Voulez vous avoir des information a propos de ce domaine? <a href='$PHP_SELF?actio=show&WhoIsServer=$WhoIsServer&domain=$domain' target='_self'>Oui</a> / <a href='#' target='_self'>Non</a>  </b></font><br><br></td></tr></table><br><br><br><br><br>");
                           }
      }
    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("<table border=1 width=640 align=center><tr>");
                printf("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain est libre!</b></font></td></tr></table><br><br><br><br><br>");
                }

        else if (substr("$result" ,0, 7) == "domain:") {
               printf ("<table border=1 width=640 align=center><tr>");
                printf ("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain n est pas libre</b></font><br><br>");
                printf ("<font face='arial' size='2' color='#4E566B'><b>Voulez vous avoir des information a propos de ce domaine? <a href='$PHP_SELF?actio=show&WhoIsServer=$WhoIsServer&domain=$domain' target='_self'>Oui</a> / <a href='#' target='_self'>Non</a>  </b></font><br><br></td></tr></table><br><br><br><br><br>");
                           }
      }
    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("<table border=1 width=640 align=center><tr>");
                printf("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain est libre!</b></font></td></tr></table><br><br><br><br><br>");
                }

        else if (substr("$result" ,0, 7) == "domain:") {
                printf ("<table border=1 width=640 align=center><tr>");
                printf ("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain n est pas libre</b></font><br><br>");
                printf ("<font face='arial' size='2' color='#4E566B'><b>Voulez vous avoir des information a propos de ce domaine? <a href='$PHP_SELF?actio=show&WhoIsServer=$WhoIsServer&domain=$domain' target='_self'>Oui</a> / <a href='#' target='_self'>Non</a>  </b></font><br><br></td></tr></table><br><br><br><br><br>");
                           }
      }
    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("<table border=1 width=640 align=center><tr>");
                printf("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain est libre!</b></font></td></tr></table><br><br><br><br><br>");
                }

        else if (substr("$result" ,0, 7) == "domain:") {
                printf ("<table border=1 width=640 align=center><tr>");
                printf ("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain n est pas libre</b></font><br><br>");
                printf ("<font face='arial' size='2' color='#4E566B'><b>Voulez vous avoir des information a propos de ce domaine? <a href='$PHP_SELF?actio=show&WhoIsServer=$WhoIsServer&domain=$domain' target='_self'>Oui</a> / <a href='#' target='_self'>Non</a>  </b></font><br><br></td></tr></table><br><br><br><br><br>");
                           }
      }
    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("<table border=1 width=640 align=center><tr>");
                printf("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain est libre!</b></font></td></tr></table><br><br><br><br><br>");
                }

        else if (substr("$result" ,0, 7) == "Domain ") {
                printf ("<table border=1 width=640 align=center><tr>");
                printf ("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain n est pas libre</b></font><br><br>");
                printf ("<font face='arial' size='2' color='#4E566B'><b>Voulez vous avoir des information a propos de ce domaine? <a href='$PHP_SELF?actio=show&WhoIsServer=$WhoIsServer&domain=$domain' target='_self'>Oui</a> / <a href='#' target='_self'>Non</a>  </b></font><br><br></td></tr></table><br><br><br><br><br>");
                           }
      }
    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("<table border=1 width=640 align=center><tr>");
                printf("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain est libre!</b></font></td></tr></table><br><br><br><br><br>");
                }

        else if (substr("$result" ,0, 7) == "Domain ") {
                printf ("<table border=1 width=640 align=center><tr>");
                printf ("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain n est pas libre</b></font><br><br>");
                printf ("<font face='arial' size='2' color='#4E566B'><b>Voulez vous avoir des information a propos de ce domaine? <a href='$PHP_SELF?actio=show&WhoIsServer=$WhoIsServer&domain=$domain' target='_self'>Oui</a> / <a href='#' target='_self'>Non</a>  </b></font><br><br></td></tr></table><br><br><br><br><br>");
                           }
      }
    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("<table border=1 width=640 align=center><tr>");
                printf("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain est libre!</b></font></td></tr></table><br><br><br><br><br>");
                }

        else if (substr("$result" ,0, 7) == "domain:") {
                printf ("<table border=1 width=640 align=center><tr>");
                printf ("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain n est pas libre</b></font><br><br>");
                printf ("<font face='arial' size='2' color='#4E566B'><b>Voulez vous avoir des information a propos de ce domaine? <a href='$PHP_SELF?actio=show&WhoIsServer=$WhoIsServer&domain=$domain' target='_self'>Oui</a> / <a href='#' target='_self'>Non</a>  </b></font><br><br></td></tr></table><br><br><br><br><br>");
                           }
      }
    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("<table border=1 width=640 align=center><tr>");
                printf("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain est libre!</b></font></td></tr></table><br><br><br><br><br>");
                }

        else if (substr("$result" ,0, 7) == "domain:") {
                printf ("<table border=1 width=640 align=center><tr>");
                printf ("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain n est pas libre</b></font><br><br>");
                printf ("<font face='arial' size='2' color='#4E566B'><b>Voulez vous avoir des information a propos de ce domaine? <a href='$PHP_SELF?actio=show&WhoIsServer=$WhoIsServer&domain=$domain' target='_self'>Oui</a> / <a href='#' target='_self'>Non</a>  </b></font><br><br></td></tr></table><br><br><br><br><br>");
                           }
      }
    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("<table border=1 width=640 align=center><tr>");
                printf("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain est libre!</b></font></td></tr></table><br><br><br><br><br>");
                }

        else if (substr("$result" ,0, 7) == "domain:") {
                printf ("<table border=1 width=640 align=center><tr>");
                printf ("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain n est pas libre</b></font><br><br>");
                printf ("<font face='arial' size='2' color='#4E566B'><b>Voulez vous avoir des information a propos de ce domaine? <a href='$PHP_SELF?actio=show&WhoIsServer=$WhoIsServer&domain=$domain' target='_self'>Oui</a> / <a href='#' target='_self'>Non</a>  </b></font><br><br></td></tr></table><br><br><br><br><br>");
                           }
      }
    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("<table border=1 width=640 align=center><tr>");
                printf("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain est libre!</b></font></td></tr></table><br><br><br><br><br>");
                }

        else if (substr("$result" ,0, 7) == "domain:") {
                printf ("<table border=1 width=640 align=center><tr>");
                printf ("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain n est pas libre</b></font><br><br>");
                printf ("<font face='arial' size='2' color='#4E566B'><b>Voulez vous avoir des information a propos de ce domaine? <a href='$PHP_SELF?actio=show&WhoIsServer=$WhoIsServer&domain=$domain' target='_self'>Oui</a> / <a href='#' target='_self'>Non</a>  </b></font><br><br></td></tr></table><br><br><br><br><br>");
                           }
      }
    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("<table border=1 width=640 align=center><tr>");
                printf("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain est libre!</b></font></td></tr></table><br><br><br><br><br>");
                }
        else if (substr($result, 0, 13) == "Whois Server:"){
                $WhoIsServer = trim(ereg_replace("Whois Server:"," ",$result));
                printf ("<table border=1 width=640 align=center><tr>");
                printf ("<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain n est pas libre</b></font><br><br>");
                printf ("<font face='arial' size='2' color='#4E566B'><b>Voulez vous avoir des information a propos de ce domaine? <a href='$PHP_SELF?actio=show&WhoIsServer=$WhoIsServer&domain=$domain' target='_self'>Oui</a> / <a href='#' target='_self'>Non</a>  </b></font><br><br></td></tr></table><br><br><br><br><br>");

              }
      }
   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 "<table border=1 width=640 align=center><tr><td><PRE>";
                        while (!feof($fps)) {
                                $result = fgets($fps, 2048);
                     echo "$result";
            }
        echo "</td></tr></table></PRE>";
        fclose($fps);
      }
else echo("Impossible d'affiche la date.\n");

}

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

}
?>
</head>

<body>

<table border="0" width="640" align=center>
        <tr>
                <td width="130" valign="top" align="left"><font face="Arial" size="2"><b>Verification de nom de domaine:</b></font></td>
                <td width="283" valign="top" align="left"><form action="<? echo $PHP_SELF ?>" method="POST" target="_self"><font face="Verdana" size="2"><b>www. <input type="text" name="domainname" size="17">&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></b></font>
                <td width="88" valign="top" align="left"><font face="Arial" size="2"><b><input type="submit" name="submit" value="Verifier"></b></font></td>
                <td width="121" valign="top" align="left"><font face="Arial" size="2"><b><input type="reset" value="Effacer"></b></font></td></form>
        </tr>

</table>

</body>
</html>

A voir également

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.