salut j'ai trouver un script de vérification nom domaine
maintenant je veux le developper on ajoutant un formulaire pour que le client puissent commander sans nom domaine

pour le script verification nom domaine voila j'ai 4 extension (com, net, net, ma)
j'ai introduis une condtion je comparer nom domaine+extension paraport au serveur s'il trouve j'affiche déjà reservé et checkbox sinon Disponible checkbox.
http://www.intervallemedia.com/whois1/domain.php

le probleme que j'ai eu c'est comment recuperer la valeur du checkbox si le client coche l'une ou tous parmi checkbox ainsi le checkbox se duplique alors j'aurai deux chekbox ou plus qui ont le même name ?
c'est pour cela j'ai penser de recuperer la valeur a l'aide de l'index du checkbox on integrant un compteur
et la magie du javascript

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
function voila(choix)
{
vchoix=document.forms['domain'].element[choix].value;
 
}
maleursement ca na pas marcher
voila tous le 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
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
196
197
198
199
200
201
202
<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
$sitetitle="intervallemedia"; //nom du site
$description="Nom domaine"; // 
?>
 
<!-- Designed by: v9v9.net --><head>
<title><?=$sitetitle?></title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250" />
<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
<script type="text/JavaScript">
<!--
 
function voila(choix)
{
vchoix=document.forms['domain'].element[choix].value;
alert('vchoix');
}
</head>
 
<body onload="MM_preloadImages('images/pack hebergement/packs_lunix-vert.jpg','images/packs_lunix_bleu.jpg')">
 
 
<form id="domain" name="domain" method="post" action="domain.php">
  <div id="container">
    <div id="header">
      <h1><a title="<?=$sitetitle?>" href="index.php">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <?=$sitetitle?>
      </a></h1>
      <h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          <?=$description?>
      </h2>
    </div>
    <div id="menu">
      <ul>
        <li><a title="<?=$sitetitle?>" href="index.php">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
              <?=$sitetitle?>
        </a></li>
      </ul>
    </div>
    <div id="content">
      <div id="main">
        <h1>
          <?=$sitetitle?>
        </h1>
        <label></label>
        <label> </label>
        WWW.
        <label>
          <input name="domainname" type="text" class="text" id="domainname" />
          &nbsp;
          <input name="submitBtn" type="submit" id="submitBtn" value="Envoyer" />
        </label>
        <ul>
          <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <input name="com" type="checkbox" id="com" />
            com </li>
          <li>
            <input name="net" type="checkbox" id="net" />
            net </li>
          <li>
            <input name="org" type="checkbox" id="org" />
            org </li>
          <li>
            <input name="ma" type="checkbox" id="ma" />
            ma </li>
          <li>
            <input name="all" type="checkbox" id="all" checked="checked" />
            all </li>
        </ul>
        <?php
if (isset($_POST['submitBtn'])){
$domainbase = (isset($_POST['domainname'])) ? $_POST['domainname'] : '';
$d_all      = (isset($_POST['all'])) ? 'all' : '';
$d_com      = (isset($_POST['com'])) ? 'com' : '';
$d_net      = (isset($_POST['net'])) ? 'net' : '';
$d_org      = (isset($_POST['org'])) ? 'org' : '';
$d_info     = (isset($_POST['ma']))  ? 'ma'  : '';
if (strlen($domainbase)>2){
?>
        <h1 align="right">Resultat de la recherche </h1>
      </div>
      <div id="bottom">
        <table width="587" border="0">
          <tr>
            <td valign="top"><label><img src="images/tableau domaine.jpg" width="584" height="25" /><br />
            </label>
			<?php
    function checkDomain($domain,$server,$findText){
 
        $con = fsockopen($server, 43);
        if (!$con) return false;
 
 
        fputs($con, $domain."\r\n");
 
 
        $response = ' :';
        while(!feof($con)) {
            $response .= fgets($con,128);
        }
 
 
        fclose($con);
 
 
        if (strpos($response, $findText)){
            return true;
        }
        else {
            return false;
        }
    }
 
    function showDomainResult($domain,$server,$findText){
	$compteur=0;
       if (checkDomain($domain,$server,$findText)){
          //echo "<p><span id='green'>indisponible:</span> $domain</p>";
 
		  ?>
 
              <table width="581" border="0">
                <tr>
                  <td width="69">
                    <input name="1" type="checkbox" id="1" value="oui" />                  </td>
                  <td width="21" align="right"><img src="images/accept.png" width="21" height="21" /></td>
                  <td width="135" align="left"><font color="#00CC33"><span class="Style1"><?php print($domain); ?></span></font></td>
                  <td width="91"><span class="Style6">&nbsp;Disponible </span></td>
                  <td width="153">
                    <select name="select4">
                      <option>---------------------</option>
                    </select>                  </td>
                  <td width="86">
                    <select name="select" class="text">
                      <option selected="selected">1ans</option>
                      <option>2ans</option>
                      <option>3ans</option>
                      <option>4ans</option>
                    </select>                  </td>
                </tr>
              </table>
			  <?php print($compteur); ?>
              <label><img src="images/bar.jpg" width="572" height="1" /></label><?php $compteur++; ?></td>
          </tr><br />
 
           <?php
 
       }
       else{ //echo "<p><span id='red'>disponible:</span> <strike>$domain</strike></p>";
	   ?>
          <tr>
            <td height="31" valign="top"><label></label>
              <table width="581" border="0" bgcolor="#FFFFCC">
                <tr>
                  <td width="69"><font color="#FF0000">
                    <input name="2" type="checkbox" id="2" value="oui" />
                  </font></td>
                  <td width="21" align="right"><img src="images/refresh.png" width="21" height="21" /></td>
                  <td width="135" align="left"><font color="#FF0000"><span class="Style1"><?php print($domain); ?></span></font></td>
                  <td width="91"><span class="Style6">&nbsp;<span class="Style7">D&eacute;j&agrave; r&eacute;serv&eacute; </span> </span></td>
                  <td width="153"><font color="#FF0000">
                        <select name="select2">
                          <option>---------------------</option>
                        </select>                  </td>
                  <td width="86">
                    <select name="select2" class="text">
                      <option selected="selected">1ans</option>
                      <option>2ans</option>
                      <option>3ans</option>
                      <option>4ans</option>
                    </select>                  </td>
                </tr>
              </table>
              <img src="images/bar.jpg" width="572" height="1" /></td>
          </tr>
          <?php
  }
}
if (($d_com != '') || ($d_all != '') ) showDomainResult($domainbase.".com",'whois.crsnic.net','No match for');
if (($d_net != '') || ($d_all != '') ) showDomainResult($domainbase.".net",'whois.crsnic.net','No match for');
if (($d_org != '') || ($d_all != '') ) showDomainResult($domainbase.".org",'whois.publicinterestregistry.net','NOT FOUND');
if (($d_info != '') || ($d_all != '') ) showDomainResult($domainbase.".ma",'whois.ripe.net','NOT FOUND');    
 
}
 
 
?>
        </table>
		<br />
		<br />
		<br />
		<br />
		<label><a href="" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image6','','images/packs_lunix_bleu.jpg',1)" onclick="voila()"><img src="images/packs_lunix-vert.jpg" name="Image6" width="80" height="22" border="0" id="Image6" /></a><a href="formulaire.php?" onclick="voila(<?php print($compteur); ?>)" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image3','','images/pack hebergement/packs_lunix-vert.jpg',1)"></a></label>
		<?php } ?>
      </div> 
    </div>
    <div id="footer"></div>
  </div>
</form>
</body>
</html></script>