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
| echo "<table style='font-family: Bookman Old Style; text-align: left; width: 40%;' border='0' cellpadding='3' cellspacing='0'>";
echo "<tr bgcolor='#CCCCCC'>";
echo "<td><font size='2'><b><a href='index.php'>...</a> > <a href='?page=1&cp=".$choix_cp."'>".$choix_cp."</a></b></font></td>";
echo "</tr>";
echo "</table><br>";
/* requête SQL qui compte le nombre total d'enregistrement dans la table et qui récupère tous les enregistrements */
$select = "SELECT cp FROM contenu GROUP BY cp ORDER by cp";
$result = mysqli_query($link_ccp,$select) or die ("Erreur : ".mysql_error() );
/* ----- Creation du tableau liste de choix cp ----- */
echo "<form name='afficher_cp' method='post' action='?page=2'>";
echo "<center><table width='50%' border='0' bgcolor='#FFFFBB'>";
echo "<tr>";
echo "<td width='15%' align='right'><font face = 'Times New Roman'>Choix du CP :</font></td>";
echo "<td width='30%' align='center'><select name='liste_cp' style='width:150px;align:center' onChange='javascript:this.form.submit();' >";
while ($row = mysqli_fetch_array($result))
{
if ( $choix_cp == $row['cp'] )
echo "<option selected VALUE='".$row['cp']."'>".$row['cp']."</option>";
else
echo "<option VALUE='".$row['cp']."'>".$row['cp']."</option>";
}
echo "</select>";
echo "</td>";
echo "</tr>";
echo "</table></center></form>";
mysqli_free_result($result); |
Partager