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 52 53
| if(!isset($_POST['btValider']))
{
echo'
<form onsubmit="return verif()"action="index.php?page=fichier.php" method="post" enctype="multipart/form-data">
<p>
<label for="playlist">Playlist :</label>
<SELECT name="playlist">';
$playlistsoiree=new playlistsoiree($db);
$liste=$playlistsoiree->selectAll();
foreach ($liste as $unplaylistsoiree)
{
echo '<option value='.$unplaylistsoiree['idplaylist'].'>'.$unplaylistsoiree['titre'].'</option>';
}
echo'</select> </p>
<input type="submit" id="btValider" name="btValider" />
<input type="reset" value="Réinitialiser" /> <br />
</form>';
}
else
{
// récup de l'id
$idplaylistsoiree=$_POST['playlist'];
echo $idplaylistsoiree;
// recup du nombre de champs
$playlistsoiree = new playlistsoiree($db);
$nbchamp=$playlistsoiree->selectOne($idplaylistsoiree);
echo $nbchamp['nbchamp'];
if(!isset($_POST['btValider2']))
{
echo'<form onsubmit="return verif()"action="index.php?page=fichier2.php" method="post" enctype="multipart/form-data">';
for ($i=1; $i<=$nbchamp['nbchamp']; $i++)
{
echo' <p><label for="champ">Champ '.$i.' :</label>
<input type ="text" id="champ'.$i.'" name="champ'.$i.'" />
</p> ';
}
echo' <input type="submit" id="btValider2" name="btValider2" />
<input type="reset" value="Réinitialiser" /> <br />
</form>';
}
} |
Partager