Bonsoir,
j'ai un tableau qui presente la liste des enregistrement d'une de mes tables pour en modifier celui qui sera valider. j'ai donc mi une case à cocher pour choisir la ligne qui sera modifier, voilà où je plante je ne sais pas comment faire pour savoir quelle ligne a été choisi (dans mon code en fait)
Merci de m'aider.
<?php include("config.php");?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Document sans titre</title>
<style type="text/css">
<!--
.Style4 {font-size: 30px; font-variant: normal; color: #1241BC; font-family: Algerian;}
-->
</style>
</head>
<body>
<div align="center" class="Style4">LISTE DES CLIENTS</div>
<p> </p>
<p> </p>
<?php
//récupère tous les enregistrements
$select = 'SELECT codescte,nomscte,adrsgeo,tel,fax,dtescte FROM societe';
$result = mysql_query($select) or die ('Erreur : '.mysql_error() );
$total = mysql_num_rows($result);
$Nmax = 10; // nombre par page
$Ncur = 0; // n° de la fiche courante
$Ndeb=@$_GET["num"]; // 1ère fiche transmise par l'URL
// si on a récupéré un résultat on l'affiche.
if($total) {
?>
<table width="616" border="2" align="center">
<tr>
<td width="52">CODE</td>
<td width="90"><div align="center">SOCIETE</div></td>
<td width="112"><div align="center">ADRESSE</div></td>
<td width="89"><div align="center">TELEPHONE</div></td>
<td width="92"><div align="center">FAXE</div></td>
<td width="155"><div align="center">DATE D'ENREGISTREMENT </div></td>
<td width="155">MODIFIER</td>
</tr>
<?php
// tant qu'il y a des fiches
while (($row = mysql_fetch_array($result))
&& ($Ncur<$Nmax+$Ndeb)) {
if($Ncur>=$Ndeb) {
?>
<tr>
<td><?php echo ($row['codescte']); ?></td>
<td><?php echo ($row['nomscte']); ?></td>
<td><?php echo ($row['adrsgeo']); ?></td>
<td><?php echo ($row['tel']); ?></td>
<td><?php echo ($row['fax']); ?></td>
<td><?php echo date("d/m/Y H:i:s",$row['dtescte']); ?></td>
<td><form name="form1" method="post" action="modif.php">
<label>
<input type="checkbox" name="checkbox" value="Modifier">
</label>
</form>
</td>
</tr>
<?php }
// une de plus
$Ncur++;
}?>
</table>
<br>
</div>
<table align="center" cellpadding=3>
<tr>
<?php // Navigation
// Des fiches avant ?
if($Ndeb > 0) { ?>
<td valign=top>
<A href="?num=<?php echo $Ndeb-$Nmax; ?>">Retour</A> </td>
<?php } ?>
<td>
<?php // N° des pages
$Npag = ceil(mysql_numrows($result)/$Nmax);
for($i = 1;$i<=$Npag;$i++) {
// Page courante ?
if($Ndeb == ($i-1)*$Nmax) { ?>
<?php echo $i; ?>
<?php } else { ?>
<A href=""
> <?php echo $i; ?> </A>
<?php }
} ?> </td>
<?php // Des fiches après ?
if($row) { ?>
<td valign=top>
<A href="?num=<?php echo $Ncur; ?>">Suite</A> </td>
<?php } ?>
</tr></table>
<?php
echo '</table>'."\n";
// fin du tableau.
} ?>
</body>
</html>
Configuration: Windows 2003
Firefox 3.5.2