<?php
include("connect.php");
$menu = mysql_query("select idinter from intervention
where statut='In' or statut='En cours' or statut='En attente' or statut='Out'"
);
$requette="select clienti.nom,
....
intervention.ligne,
....
from clienti,intervention,machine
where clienti.idclient=machine.clientid and idmachine=machineid and idinter='".$_GET['var']."'";
$sql = mysql_query($requette) or die('Erreur SQL');
echo "<table width=\"100%\" >";
while(list(... $ligne, ... ) = mysql_fetch_array($sql)) {
?>
<form method="post" name="post" action="miseajourinter.php?varia=<?php echo $idinter?>">
<?php
......
if ($resolution!='')
{
$listeCoche="";
$monTableau=explode("\n", $resolution);
$maListeDeLignesCochees=explode(",", $ligne);
$nb=count($monTableau);
for($i=0; $i<$nb; $i++) {
echo $monTableau[$i];
$checked = "";
if(in_array($i, $maListeDeLignesCochees))
{
$checked=' checked="checked"'; // si la ligne est dans la liste, la case sera cochée
$lignee=1;
}else
{$lignee=0;}
$listeCoche.=$lignee.',';
echo '<input type="checkbox" name="ligne" value="'.$i.'" '. $checked.'>';
echo '<br>'; // retour à la ligne
}
echo '<input type="hidden" name="line" value='.$listeCoche.' >';
}
<center> <input name="submit" type="submit" class="champ" value="Vhasy"> </center></td></tr>
<?php }?>
</form> </table> et ou je le receptionne : <?php
include("connect.php");
mysql_connect("localhost", "root", "");
mysql_select_db("dit");
...
$ligne = $_POST["line"];
...
if(isset($_POST['submit']))
{
$requette="UPDATE intervention SET notetech='$notetech',
....
ligne='$ligne',
....
WHERE idinter='".$_GET['varia']."'";
$repon = mysql_query($requette) or die('Erreur SQL');
echo "$ligne + voili voilou ca marche pas ....";
....