IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

EDI, CMS, Outils, Scripts et API PHP Discussion :

[Forum] Recherche de domaine dans mon site [Sources]


Sujet :

EDI, CMS, Outils, Scripts et API PHP

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre éclairé Avatar de stanley
    Webmaster
    Inscrit en
    Décembre 2004
    Messages
    270
    Détails du profil
    Informations personnelles :
    Âge : 39

    Informations professionnelles :
    Activité : Webmaster

    Informations forums :
    Inscription : Décembre 2004
    Messages : 270
    Par défaut [Forum] Recherche de domaine dans mon site
    Bonjour,

    Je voudrais intégrer dans mon site est un sytème de recherche de disponibilité de noms de domaine.

    Si quelqu'un connait un tuto sur ça, ça me ferait plaisir qu'il me le passe.


    Merci

  2. #2
    Modérateur
    Avatar de blueice
    Homme Profil pro
    Développeur Web
    Inscrit en
    Mars 2003
    Messages
    3 494
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 50
    Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Mars 2003
    Messages : 3 494
    Par défaut
    J'espère que le script n'est pas encore présent sur DVP...

    Voilà de quoi te venir en aide je pense, le code est conforme et valide :

    Code php : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    <title>WHOIS - Pour savoir &agrave; qui appartient un nom de domaine</title>
    <style type="text/css">
    <!--
    body {
        color: black;
    }
    #conteneur {
    text-align: center;
    }
    #search {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    background-color:#CCCCCC;
    border:1px solid black;
    padding:15px 5px 5px 5px;
    width:400px;
    }
    -->
    </style></head>
     
    <body>
    <div id="conteneur">
    <h2>WHOIS</h2>
    <div id="search">
     
    <form id="form1" name="form1" method="post" action="<?php echo $PHP_SELF; ?>">
      www.<input name="domaine" type="text" size="30" />
      <input type="submit" name="Submit" value="Soumettre" />
    </form>
    </div>
    </div>
    <?php
        /********************************************************/
        /* +--------------------------------------+                */
        /* | Script WHOIS                           |            */
        /* | par Sven CAILTEUX                           |            */
        /* |    http://www.dimension-internet.com/    |            */
        /* |    info@dimension-internet.com            |            */
        /* +--------------------------------------+                */
        /********************************************************/
     
        if($_POST['domaine']){
            $whois_serveurs = array(
                "ac"=>"whois.nic.ac",
                "al"=>"whois.ripe.net",
                "am"=>"whois.amnic.net",
                "as"=>"whois.nic.as",
                "at"=>"whois.ripe.net",
                "au"=>"whois.aunic.net",
                "az"=>"whois.ripe.net",
                "ba"=>"whois.ripe.net",
                "be"=>"whois.dns.be",
                "bg"=>"whois.ripe.net",
                "biz"=>"whois.pacificroot.com",
                "br"=>"whois.registro.br",
                "by"=>"whois.ripe.net",
                "ca"=>"whois.cira.ca",
                "cc"=>"whois.nic.cc",
                "ch"=>"whois.nic.ch",
                "ck"=>"whois.ck-nic.org.ck",
                "cn"=>"whois.cnnic.net.cn",
                "com"=>"rs.internic.net",
                "cx"=>"whois.nic.cx",
                "cy"=>"whois.ripe.net",
                "cz"=>"whois.nic.cz",
                "de"=>"whois.denic.de",
                "dk"=>"whois.dk-hostmaster.dk",
                "dz"=>"whois.ripe.net",
                "edu"=>"rs.internic.net",
                "ee"=>"whois.ripe.net",
                "eg"=>"whois.ripe.net",
                "es"=>"whois.ripe.net",
                "fi"=>"whois.ripe.net",
                "fj"=>"whois.usp.ac.fj",
                "fo"=>"whois.ripe.net",
                "fr"=>"whois.nic.fr",
                "gb"=>"whois.ripe.net",
                "ge"=>"whois.ripe.net",
                "gov"=>"whois.nic.gov",
                "gr"=>"whois.ripe.net",
                "gs"=>"whois.adamsnames.tc",
                "hk"=>"whois.hknic.net.hk",
                "hm"=>"whois.registry.hm",
                "hr"=>"whois.ripe.net",
                "hu"=>"whois.ripe.net",
                "id"=>"whois.idnic.net.id",
                "ie"=>"whois.domainregistry.ie",
                "info"=>"whois.afilias.net",
                "int"=>"whois.isi.edu",
                "il"=>"whois.ripe.net",
                "is"=>"whois.isnet.is",
                "it"=>"whois.nic.it",
                "jp"=>"whois.nic.ad.jp",
                "ke"=>"whois.rg.net",
                "kg"=>"whois.domain.kg",
                "kr"=>"whois.nic.or.kr",
                "kz"=>"whois.domain.kz",
                "li"=>"whois.nic.li",
                "lk"=>"whois.nic.lk",
                "lt"=>"whois.ripe.net",
                "lu"=>"whois.ripe.net",
                "lv"=>"whois.ripe.net",
                "ma"=>"whois.ripe.net",
                "md"=>"whois.ripe.net",
                "mil"=>"whois.nic.mil",
                "mk"=>"whois.ripe.net",
                "mm"=>"whois.nic.mm",
                "ms"=>"whois.adamsnames.tc",
                "mt"=>"whois.ripe.net",
                "mx"=>"whois.nic.mx",
                "net"=>"rs.internic.net",
                "nl"=>"whois.domain-registry.nl",
                "no"=>"whois.norid.no",
                "nu"=>"whois.nic.nu",
                "nz"=>"whois.domainz.net.nz",
                "org"=>"rs.internic.net",
                "pl"=>"whois.ripe.net",
                "pk"=>"whois.pknic.net.pk",
                "pt"=>"whois.ripe.net",
                "ro"=>"whois.ripe.net",
                "ru"=>"whois.ripn.ru",
                "se"=>"whois.nic-se.se",
                "sg"=>"whois.nic.net.sg",
                "si"=>"whois.ripe.net",
                "sh"=>"whois.nic.sh",
                "sk"=>"whois.ripe.net",
                "sm"=>"whois.ripe.net",
                "st"=>"whois.nic.st",
                "su"=>"whois.ripe.net",
                "tc"=>"whois.adamsnames.tc",
                "tf"=>"whois.adamsnames.tc",
                "tj"=>"whois.nic.tj",
                "th"=>"whois.thnic.net",
                "tm"=>"whois.nic.tm",
                "tn"=>"whois.ripe.net",
                "to"=>"whois.tonic.to",
                "tr"=>"whois.ripe.net",
                "tw"=>"whois.twnic.net",
                "ua"=>"whois.ripe.net",
                "uk"=>"whois.nic.uk",
                "us"=>"whois.isi.edu",
                "va"=>"whois.ripe.net",
                "vg"=>"whois.adamsnames.tc",
                "ws"=>"whois.nic.ws",
                "yu"=>"whois.ripe.net",
                "za"=>"whois.frd.ac.za"
            );
            $parseur = explode(".", $_POST['domaine']);
     
            $hote = $whois_serveurs[strtolower($parseur[count($parseur) - 1])];
            echo "<strong>Serveur de nom =></strong> ".$hote;
     
            if (empty($hote)) {
            echo "<strong>L'extension du domaine <font color=\"red\">" .$_POST['domaine']."</font> est invalide.</strong>";
            }
     
            else{
                $fp = fsockopen($hote, 43, $errno, $errstr, 10);
                fputs($fp, $_POST['domaine']."\r\n");
                while(!feof($fp)){
                    $row = fgets($fp,128);
                    $buffer .= $row;
                    if(eregi("Whois Server:", $row))$server = trim(str_replace("Whois Server:", "", $row));
                }
                fclose($fp);
     
                if(ereg("No match for", $buffer)|| ereg("NOT FOUND", $buffer)){
                    echo "<p><strong>Le nom de domaine <font color=\"darkgreen\">".$_POST['domaine']."</font> semble libre.</strong><p>";
                }
                else{
                    echo "<p><strong>Le nom de domaine <font color=\"red\">".$_POST['domaine']."</font> est déjà pris.</strong></p>";
                    if($server){
                        echo "<p><strong><font color=\"red\">".$_POST['domaine']."</font> est enregistré chez $server :</strong></p>";
                        echo "<pre>";
                        $fp = fsockopen($server, 43, $errno, $errstr, 10);
                        fputs($fp, $_POST['domaine']."\r\n");
                        while(!feof($fp))print fgets($fp,128);
                        fclose($fp);
                        echo "</pre>";
                    }
                    else{
                        echo "<pre>$buffer</pre>";
                    }
                }
            }
        }
    ?>
    </body>
    </html>

  3. #3
    Membre éclairé Avatar de stanley
    Webmaster
    Inscrit en
    Décembre 2004
    Messages
    270
    Détails du profil
    Informations personnelles :
    Âge : 39

    Informations professionnelles :
    Activité : Webmaster

    Informations forums :
    Inscription : Décembre 2004
    Messages : 270
    Par défaut
    Merci mon cher, ça marche à merveille .

  4. #4
    Membre habitué
    Profil pro
    Inscrit en
    Avril 2007
    Messages
    11
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2007
    Messages : 11
    Par défaut
    vraiment bien ce script !! merci c'est très utile

  5. #5
    Membre habitué
    Profil pro
    Inscrit en
    Avril 2007
    Messages
    11
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2007
    Messages : 11
    Par défaut
    J'apporte une petite modification à ce script :


    if(ereg("No match for", $buffer)|| ereg("NOT FOUND", $buffer)||ereg("No entries found",$buffer)){

    En effet, pour les noms de domaines en .fr, le serveur renvoit "No entries found" et le script ne gérait pas cette phrase, du coup le nom de domaine semblait libre. Voilivoiloo !

  6. #6
    Modérateur
    Avatar de blueice
    Homme Profil pro
    Développeur Web
    Inscrit en
    Mars 2003
    Messages
    3 494
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 50
    Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Mars 2003
    Messages : 3 494
    Par défaut
    En effet, pour les noms de domaines en .fr, le serveur renvoit "No entries found" et le script ne gérait pas cette phrase, du coup le nom de domaine semblait libre. Voilivoiloo !

    En effet ! Bien vu
    Par contre c'était le contraire, même libre il semblait pris mais indiqué tout de même No entries found !

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Moteur de recherche interne dans mon site web
    Par Reweb dans le forum EDI, CMS, Outils, Scripts et API
    Réponses: 9
    Dernier message: 30/04/2015, 15h57
  2. [phpBB][3] Intégrer mon forum dans mon site
    Par Eagle_G dans le forum EDI, CMS, Outils, Scripts et API
    Réponses: 2
    Dernier message: 20/03/2010, 13h38
  3. [MySQL] Comment créer une sous catégorie dans mon site ?
    Par plex dans le forum PHP & Base de données
    Réponses: 5
    Dernier message: 18/08/2006, 09h59
  4. [FTP] Rechercher des fichiers dans un site FTP par PHP
    Par jack_1981 dans le forum Langage
    Réponses: 31
    Dernier message: 03/08/2006, 13h37
  5. Images dans mon site qui deforment tout
    Par warrendc dans le forum Balisage (X)HTML et validation W3C
    Réponses: 4
    Dernier message: 26/06/2006, 14h32

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo