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
| <?php
function getPost($param,$nb){
if(isset($_POST[$param])){
if(isset($_POST[$param][$nb])){
return $_POST[$param][$nb];
}
}
return null;
}
?>
<form name="formulaire" method="post" action="">
<p>
<label for="pays"> Veuillez sélectionnner un item et remplir les zones de saisie </label><br />
<?php
$nombre = (isset($_POST['nombre'])) ? abs(intval($_POST['nombre'])) : 0;
for ($i = $nombre; $i >= 0; $i--)
{
?>
<select NAME="ListeUrl[<?php echo $i?>]" SIZE=1 onChange="ChangeUrl(this.form)">
<option <?php if(getPost('ListeUrl',$i)=='test1.html'):?>selected="selected"<?php endif;?> value="test1.html">Geographie</option>
<option <?php if(getPost('ListeUrl',$i)=='test2.html'):?>selected="selected"<?php endif;?> value="test2.html">Histoire</option>
<option <?php if(getPost('ListeUrl',$i)=='test3.html'):?>selected="selected"<?php endif;?> value="test3.html">Chimie</option>
<option <?php if(getPost('ListeUrl',$i)=='test4.html'):?>selected="selected"<?php endif;?> value="test4.html">Anglais</option>
<option <?php if(getPost('ListeUrl',$i)=='test5.html'):?>selected="selected"<?php endif;?> value="test5.html">Espagnol</option>
<option <?php if(getPost('ListeUrl',$i)=='test6.html'):?>selected="selected"<?php endif;?> value="test6.html">Physique</option>
<option <?php if(getPost('ListeUrl',$i)=='test7.html'):?>selected="selected"<?php endif;?> value="test7.html">Francais</option>
<option <?php if(getPost('ListeUrl',$i)=='test8.html'):?>selected="selected"<?php endif;?> value="test8.html">Maths</option>
</select>
<tr>
<td><input type="text" name="note1[<?php echo $i?>]" id="note1" size="10" maxlength="10" value="<?php echo getPost('note1',$i)?>"/><td>
<td><input type="text" name="note2[<?php echo $i?>]" id="note2" size="10" maxlength="10" value="<?php echo getPost('note2',$i)?>"/><td>
<td><input type="text" name="note3[<?php echo $i?>]" id="note3" size="10" maxlength="10" value="<?php echo getPost('note3',$i)?>"/><td>
</tr><br>
<?php
}
?>
<input type="hidden" value="<?php echo ($nombre + 1); ?>" name="nombre" />
<input type="submit" value="ajouter" name="form" id="bouton" />
</p>
</form> |
Partager