Problème avec les cases à cocher

SamiEniso Messages postés 2 Date d'inscription vendredi 18 avril 2008 Statut Membre Dernière intervention 23 avril 2008 - 23 avril 2008 à 13:03
SamiEniso Messages postés 2 Date d'inscription vendredi 18 avril 2008 Statut Membre Dernière intervention 23 avril 2008 - 23 avril 2008 à 14:13
j'ai fait un tableau avec des cases à cocher dans un formulaire. lorsque ce formulaire est envoyé à la page de traitement suivante, les cases non cochées génèrent l'erreur suivante "<couleur nom="rouge">index error</couleur>".



voici le code correspondant à la déclaration des case à cocher:



<?xml:namespace prefix o ns "urn:schemas-microsoft-com:office:office" /??>

 






$port=array();$j=0;$compt=0;







if( $_POST["1"]=="on"){$port[$j]=1;$j++; }







else {$compt++;}







if( $_POST["2"]=="on"){$port[$j]=2;$j++; }







else {$compt++;}







if( $_POST["3"]=="on"){$port[$j]=3;$j++; }







else {$compt++;}







if( $_POST["4"]=="on"){$port[$j]=4;$j++; }







else {$compt++;}







if( $_POST["5"]=="on"){$port[$j]=5;$j++; }







else {$compt++;}







if( $_POST["6"]=="on"){$port[$j]=6;$j++; }







else {$compt++;}







if( $_POST["7"]=="on"){$port[$j]=7;$j++; }







else {$compt++;}







if( $_POST["8"]=="on"){$port[$j]=8;$j++; }







else {$compt++;}







if( $_POST["9"]=="on"){$port[$j]=9;$j++; }







else {$compt++;}







if( $_POST["10"]=="on"){$port[$j]=10;$j++; }







else {$compt++;}







if( $_POST["11"]=="on"){$port[$j]=11;$j++; }







else {$compt++;}







if( $_POST["12"]=="on"){$port[$j]=12;$j++; }






else {$compt++;}



if($compt==15){$etat=3;quitter($etat);}




$_SESSION['photo']=$port;$_SESSION['qtt_photo']=$_SESSION['qtt_photo']+$j;$i=0;







for($i=0;$i<$j;$i++) {







$req=mysql_query(" SELECT `designation` FROM `stock_photo` WHERE `ID`='$port[$i]' ") or die (mysql_error());







while($t= mysql_fetch_array($req)){$_SESSION['design_photo']=$_SESSION['design_photo'].$t['designation']."

";}







}








 







$i=0;$port=array();$prix=0;







foreach($_SESSION['photo'] as $element )







{  $port[$i]=$element;







$req6=mysql_query(" SELECT `prix_TTC` FROM `stock_photo` WHERE  ID='$port[$i]' ")or die (mysql_error()) ;






while($t6 = mysql_fetch_array($req6)) {$prix=$prix + $t6['prix_TTC'];}}



$_SESSION['prix_photo']=$_SESSION['prix_photo']+$prix;



mysql_close();

2 réponses

cephalic Messages postés 38 Date d'inscription jeudi 8 novembre 2007 Statut Membre Dernière intervention 25 avril 2008
23 avril 2008 à 13:50
Bonjour
Je ne vois pa ou est ta déclaration des cases a cocher.
0
SamiEniso Messages postés 2 Date d'inscription vendredi 18 avril 2008 Statut Membre Dernière intervention 23 avril 2008
23 avril 2008 à 14:13
<form id= "form1" name="form1" method="post" action="choix_autres.php">
    &nbsp;

         
        ----

          ,
          &nbsp;,
       
        ----

          ,
       
        ----

          ,
          <table height="30" width="100%">
             
                ----

                 , GSNO007283

                      LW60-J2FK</td>
               
             
         
</td>
          <td class ="prod4" colspan= "6" style="border-right: 1px solid rgb(96, 127, 159); border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px; padding-left: 15px; vertical-align: middle;" align="left" width="0">             
                ----

                  ,
                  Nova AVR 1100VA

                  Solution &eacute;conomique pour la protection des PC personnels et   professionnels,
                  239&nbsp;
  ,
             
         
</td>
        </tr>
        <tr>
          <td class="prod4" style="border-left: 1px solid rgb(96, 127, 159); border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px;" align="left" width="20"></td>
          <td class="prod4" style="border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px; vertical-align: middle;" align="center" width="90">             
                ----

                  LGSNO7423

                      P1-J273F,
               
             
         
</td>
          <td class="prod4" colspan="6" style="border-right: 1px solid rgb(96, 127, 159); border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px; padding-left: 15px; vertical-align: middle;" align="left" width="">             
                ----

                  ,
                  LCD20IQON

                    Ecran LCD   Wide 20&quot; iQon

                  ,
                  370&nbsp;
  ,
             
         
</td>
        </tr>
        <tr>
          <td class="prod4" style="border-left: 1px solid rgb(96, 127, 159); border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px;" align="left" width="20"></td>
          <td class="prod4" style="border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px; vertical-align: middle;" align="center" width="90">             
                ----

                  LGSNO007284

                      LW70-J7QF,
               
             
         
</td>
          <td class="prod4" colspan="6" style="border-right: 1px solid rgb(96, 127, 159); border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px; padding-left: 15px; vertical-align: middle;" align="left" width="">             
                ----

                  ,
                  RK282AA

                    Ecran hp 22&quot;   LCD Wide Black w2207

                  ,
                  560&nbsp;
  ,
             
         
</td>
        </tr>
        <tr>
          <td class="prod4" style="border-left: 1px solid rgb(96, 127, 159); border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px;" align="left" width="20"></td>
          <td class="prod4" style="border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px; vertical-align: middle;" align="center" width="90">             
                ----

                  SNO007566

                      LW75-RDZF,
               
             
         
</td>
          <td class="prod4" colspan="6" style="border-right: 1px solid rgb(96, 127, 159); border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px; padding-left: 15px; vertical-align: middle;" align="left" width="">             
                ----

                  ,
                  e-STUDIO 120

                    Scan   unique - Copies multiples

                    Scan couleur en standard

                    * Developpeur: 70   DT

                    * Toner: 160 DT

                  * Chargeur de document ADF &agrave; 499 DT TTC,
                  1779&nbsp;
  ,
             
         
</td>
        </tr>
        <tr>
          <td class="prod4" style="border-left: 1px solid rgb(96, 127, 159); border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px;" align="left" width="20"></td>
          <td class="prod4" style="border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px; vertical-align: middle;" align="center" width="90">             
                ----

                  LGSNO0073

                      PR10-A,
               
             
         
</td>
          <td class="prod4" colspan="6" style="border-right: 1px solid rgb(96, 127, 159); border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px; padding-left: 15px; vertical-align: middle;" align="left" width="">             
                ----

                  ,
                  e-STUDIO 163

                    Syst&egrave;mes   tout-en-un A3 : fonctions copie, impression et scanner

                    * Chargeur de document   ADF &agrave; 629 DT TTC

                  ,
                  2329&nbsp;
  ,
             
         
</td>
        </tr>
        <tr>
          <td class="prod4" style="border-left: 1px solid rgb(96, 127, 159); border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px;" align="left" width="20"></td>
          <td class="prod4" style="border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px; vertical-align: middle;" align="center" width="90">             
                ----

                  LGSNO007286

                      LH09,
               
             
         
</td>
          <td class="prod4" colspan="6" style="border-right: 1px solid rgb(96, 127, 159); border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px; padding-left: 15px; vertical-align: middle;" align="left" width="">             
                ----

                  ,
                  REGZA 37C3030DG

                    T&eacute;l&eacute;viseur LCD 16/9&egrave;me 94 cm HD ready

                    R&eacute;solution   WXGA(1366x768)

                    Contraste Dynamique: 5000:1

                    2 interfaces num&eacute;riques   HDMI

                  Pied pivotant,
                  2299&nbsp;
  ,
             
         
</td>
        </tr>
      </tbody>
    </table>
         
        ----

          ,
          &nbsp;,
       
        ----

          ,
       
        ----

          ,
          <table height="30" width="100%">
             
                ----

                 , GSNO007283

                      LW60-J2FK</td>
               
             
         
</td>
          <td class ="prod4" colspan="6" style="border-right: 1px solid rgb(96, 127, 159); border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px; padding-left: 15px; vertical-align: middle;" align="left" width="0">             
                ----

                  ,
                  REGZA 46XF355DG

                    T&eacute;l&eacute;viseur LCD 16/9&egrave;me 117 cm FULL HD

                    R&eacute;solution FULL   HD(1920x1080)

                    Taux de contraste: 10 000:1

                    3 interfaces num&eacute;riques HDMI   1080p

                  Cadre ultra fin,
                  4699&nbsp;
  ,
             
         
</td>
        </tr>
        <tr>
          <td class="prod4" style="border-left: 1px solid rgb(96, 127, 159); border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px;" align="left" width="20"></td>
          <td class="prod4" style="border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px; vertical-align: middle;" align="center" width="90">             
                ----

                  LGSNO7423

                      P1-J273F,
               
             
         
</td>
          <td class="prod4" colspan="6" style="border-right: 1px solid rgb(96, 127, 159); border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px; padding-left: 15px; vertical-align: middle;" align="left" width="">             
                ----

                  ,
                  Pav&eacute; num&eacute;rique Toshiba PX1257E

                   

                  ,
                  33&nbsp;
                  ,
               
             
         
</td>
        </tr>
        <tr>
          <td class="prod4" style="border-left: 1px solid rgb(96, 127, 159); border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px;" align="left" width="20"></td>
          <td class="prod4" style="border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px; vertical-align: middle;" align="center" width="90">             
                ----

                  LGSNO007284

                      LW70-J7QF,
               
             
         
</td>
          <td class="prod4" colspan="6" style="border-right: 1px solid rgb(96, 127, 159); border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px; padding-left: 15px; vertical-align: middle;" align="left" width="">&nbsp;</td>
        </tr>
        <tr>
          <td class="prod4" style="border-left: 1px solid rgb(96, 127, 159); border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px;" align="left" width="20"></td>
          <td class="prod4" style="border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px; vertical-align: middle;" align="center" width="90">             
                ----

                  SNO007566

                      LW75-RDZF,
               
             
         
</td>
          <td class="prod4" colspan="6" style="border-right: 1px solid rgb(96, 127, 159); border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px; padding-left: 15px; vertical-align: middle;" align="left" width="">             
                ----

                  ,
                  TOSH320GO

                  Disque Dur   externe Toshiba 320 Go 3.5&quot;,
                  229&nbsp;&nbsp;
                  ,
               
             
         
</td>
        </tr>
        <tr>
          <td class="prod4" style="border-left: 1px solid rgb(96, 127, 159); border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px;" align="left" width="20"></td>
          <td class="prod4" style="border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px; vertical-align: middle;" align="center" width="90">             
                ----

                  LGSNO0073

                      PR10-A,
               
             
         
</td>
          <td class="prod4" colspan="6" style="border-right: 1px solid rgb(96, 127, 159); border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px; padding-left: 15px; vertical-align: middle;" align="left" width="">             
                ----

                  ,
                  Sac &agrave; dos TOSHIBA Mobile Pro HSBPRO

                   

                  ,
                  134&nbsp;&nbsp;
                  ,
               
             
         
</td>
        </tr>
        <tr>
          <td class="prod4" style="border-left: 1px solid rgb(96, 127, 159); border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px;" align="left" width="20"></td>
          <td class="prod4" style="border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px; vertical-align: middle;" align="center" width="90">             
                ----

                  LGSNO007286

                      LH09,
               
             
         
</td>
          <td class="prod4" colspan="6" style="border-right: 1px solid rgb(96, 127, 159); border-bottom: 1px solid rgb(96, 127, 159); padding-top: 5px; padding-bottom: 5px; padding-left: 15px; vertical-align: middle;" align="left" width="">             
                ----

                  ,
                  Sacoche TOSHIBA Basic PX1181E,
                  85&nbsp;&nbsp;
                  ,
               
             
         
</td>
        </tr>
      </tbody>
    </table>
    trdtrdtrrrrrrrrdtrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrhghgfhfg
     
   

    &nbsp;

    &nbsp;

  </form>
0