Bonjour,

j'ai recupéré un script php de vérification de la disponibilité d'un nom de domaine sur un site qui permet de le tester en temps réel et oui c'est ce script que je recherchais depuis un bon moment mais le hic il m'affiche des erreurs.

je vous ai fait une capture afin que vous puissiez mieux m'aider:

"

Mon code:

Code : 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
 
 
 <?php
 
 
$result = '';
$theNdd = trim($_POST['theNdd']);
$theExt = $_POST['theExt'];
 
if (!empty($theNdd) AND !empty($theExt)) {
 
       $theNdd = preg_replace(array( '/http://www./',
                                     '/http:///',
                                     '/www./' ),
                              array( '', '', '') ,$theNdd);
 
       $theNdd = preg_replace(array( '/.eu/',
                                     '/.fr/',
                                     '/.com/',
                                     '/.net/',
                                     '/.org/',
                                     '/.info/',
                                     '/.biz/',
                                     '/.de/',
                                     '/.me.uk/',
                                     '/.co.uk/',
                                     '/.org.uk/',
                                     '/.ca/' ),
               array( '', '', '', '', '', '', '', '', '', '', '', '') ,$theNdd);
 
        $theNdd = escapeshellcmd($theNdd);
        //on definit les case du tableau à vérifier
        $caseForVerif['.net']=7;
        $caseForVerif['.com']=7;
        $caseForVerif['.org']=0;
        $caseForVerif['.fr']=13;
        $caseForVerif['.ca']=5;
        $caseForVerif['.info']=0;
        $caseForVerif['.biz']=1;
        $caseForVerif['.de']=35;
        $caseForVerif['.eu']=50;
        $caseForVerif['.me.uk']=30;
        $caseForVerif['.co.uk']=30;
        $caseForVerif['.org.uk']=40;
        //on definit les phrase à vérifier dans ces cases
        $strForVerif['.com']='No match for "'.$theNdd.'.COM".';
        $strForVerif['.fr']='%% No entries found in the AFNIC Database.';
        $strForVerif['.net']='No match for "'.$theNdd.'.NET".';
        $strForVerif['.org']='NOT FOUND';
        $strForVerif['.ca']='';
        $strForVerif['.info']='NOT FOUND';
        $strForVerif['.biz']='';
        $strForVerif['.de']='';
        $strForVerif['.eu']='';
        $strForVerif['.me.uk']='';
        $strForVerif['.co.uk']='';
        $strForVerif['.org.uk']='';
        foreach($theExt as $anExt) {
            $myArray="";
            $anExt=escapeshellcmd($anExt);
            exec('whois '.$theNdd.$anExt,$myArray,$retval);
            $result.=(strtolower($myArray[$caseForVerif[$anExt]])==
                      strtolower($strForVerif[$anExt]))?"->> ".$theNdd.$anExt."
                      est libre<br/>":"->> ".$theNdd.$anExt."
                      est déjà réservé<br />";
        }
}
?>
                       <h1 id="titre_search_php">Vérificateur de Nom De Domaine</h1>
        <div class="txt-lst">
         <div id="marg_4">
 
                         <p align="center" style="padding-right:8px">
                          <form action="" name="formVeirfNdd" enctype="multipart/form-data" method="post"><input type="hidden" name="PHPSESSID" value="" />
                           <table width="100%" cellspacing="10" cellpadding="10" class="code">
                            <tr>
                            <td colspan="4"><strong>www.</strong><input type="text" name="theNdd" style="width:300px" value="" /></td>
                            </tr>
                            <tr>
                            <td align="left"><input name="theExt[]" type="checkbox" value=".eu" id="eu" checked><label for="eu">.eu</label></td>
                            <td align="left"><input name="theExt[]" type="checkbox" value=".fr" id="fr"><label for="fr">.fr</label></td>
                            <td align="left"><input name="theExt[]" type="checkbox" value=".com" id="com"><label for="com">.com</label></td>
                            <td align="left"><input name="theExt[]" type="checkbox" value=".net" id="net"><label for="net">.net</label></td>
                            </tr>
                            <tr>
                            <td align="left"><input name="theExt[]" type="checkbox" value=".org" id="org"><label for="org">.org</label></td>
                            <td align="left"><input name="theExt[]" type="checkbox" value=".info" id="info"><label for="info">.info</label></td>
                            <td align="left"><input name="theExt[]" type="checkbox" value=".biz" id="biz"><label for="biz">.biz</label></td>
                            <td align="left"><input name="theExt[]" type="checkbox" value=".de" id="de"><label for="de">.de</label></td>
                            </tr>
                            <tr>
                            <td align="left"><input name="theExt[]" type="checkbox" value=".ca" id="ca"><label for="ca">.ca</label></td>
                            <td align="left"><input name="theExt[]" type="checkbox" value=".me.uk" id="me.uk"><label for="me.uk">.me.uk</label></td>
                            <td align="left"><input name="theExt[]" type="checkbox" value=".co.uk" id="co.uk"><label for="co.uk">.co.uk</label></td>
                            <td align="left"><input name="theExt[]" type="checkbox" value=".org.uk" id="org.uk"><label for="org.uk">.org.uk</label></td>
                            </tr>
                            <tr>
                            <td colspan="4" align="center"><input type="submit" value="V&eacute;rifier la disponibilité"></td>
                            </tr>
                           </table>
                          <br />
                         </form>
 
                         <?php echo '<h3>'.$result.'</h3>';  ?>