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 48 49 50 51
| <html>
<head>
<title>
traitement-06
</title>
</head>
<body>
<form method="get" action="traitement-06.php">
Choisissez votre table :
<select name="liste1">
<?
for($i=1;$i<21;$i++)
{
$selected = '';
if ($liste1==$i) {$selected="selected";}
echo("<option $selected value=".$i.">".$i."</option>");
}
?>
</select>
<br>
Choisissez le nombre de lignes :
<select name="liste2">
<?
for($i=10;$i<21;$i++)
{
$selected = '';
if ($liste2==$i) {$selected="selected";}
echo("<option $selected value=".$i.">".$i."</option>");
}
?>
</select>
<br>
<input type="submit" value="Afficher la table choisie">
<br><br>
</form>
<?
if((isset($_get['liste1']))||(isset($_get['liste2'])))
{
$liste1=$_get['liste1'];
$liste2=$_get['liste2'];
for($i=0;$i<=$_get['liste2'];$i++)
{
echo($i." * ".$_get['liste1']." = ");
echo($i * $_get['liste1']);
}
}
?>
</body>
</html> |