bonjour, j'ai un petit souci, je genere un petit pavé HTML de 1 checkbox + texte + input type texte par ligne, et quand on envoi le formulaire j'affiche les resultats avec un foreach (que j'apprends à peine a utiliser), mais le programme me marque : Warning: Invalid argument supplied for foreach() in C:\Programmes\wampserver2.0c\www\intranet\popup_barebone.php on line 195
(la ligne 195 est la ligne du foreach)

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
<table width="280" border="0" cellspacing="0" cellpadding="0" align='center'>    
  <?php  
  $Count = 0;
  for( $p = $Pas; $p <= $NbSLOT; $p += $Pas)
  {
    for( $tb = 1; $tb <= $MaxSizeBarrette; $tb *= 2 )
    {
      $TotRAMcalcule =  $p * $tb;
      //echo $TotRAMcalcule;
      if( $TotRAMcalcule <= $MaxRAM )
      {
        $Count++;
        $Check = "CHECK_".$p."_".$tb;
        $Val = "FSB".$Count;
        echo "<tr><td height='30' align='left' valign='bottom'><label><input type='checkbox' id='CHECK[]'  name='CHECK[]' value='".$Count."'>";
        echo "<font face='arial' size='2' color='#000000'><b>".$p."</b> barrettes de <b>".$tb."Go</b> (".$TotRAMcalcule."/".$MaxRAM."Go)</font> ";
        echo "</label></td><td width='45' valign='bottom'>";
        echo "<input type='text' id='FSB".$Count."' name='FSB".$Count."' size='3' value='";
 
        if( isset( $_POST[$Val] ) )
        {
          echo $_POST[$Val];
        }
        else
        {
          echo $FSB; 
        }
        echo "' onchange='ModificationFSB(this);'></td></tr>";
      }
 
      if( isset( $_POST['ok'] ) )
      {
        foreach( $_POST['CHECK'] as $CC )
        {
          $Value = "FSB".$CC;
          echo "$CC<br>\r\n";
          echo $_POST[$Value]."<br>\r\n";
        }
      }
    }
  }
  ?>
  <tr>
    <td colspan="2"><br /></font><center>
    <input type="submit" id="ok" name="ok" value="Envoyer"></center></td>
  </tr>
</table>
merci bcp !