Salut tous,
voilà, je voudrais permettre à un utilisateur de saisir une liste de fichiers avant de les uploader. Mais je ne réussi pas à garder en mémoire les fichiers : j'ai une liste dans laquelle je peux rajouter des noms de fichiers en cliquant sur un bouton "ajouter". Ce bouton me recharge la page en mettant à jour cette liste (enfin c'est ce que je voulais que ça fasse), mais là c'est le drame...
si quelqu'u a la bonté d'aider un débutant en php, je lui serai très reconnaissant.
voici le code de ma page :
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title></title>
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="author" content="jht">
</head>
<body>
<table width="800" height="600" border="1" bgcolor="#FFFFCC" summary="">
<tr>
<td width="120" height="600" bgcolor="#FFFFFF">
<table width="100%" height="100%" border="0" summary="">
<tr>
<td bgcolor="#FFFFCC" align="center"><b>Etape 1</b><br>Choix des <br>fichiers</td>
</tr>
<tr>
<td align="center"><b>Etape 2</b><br>Téléchargement des fichiers</td>
</tr>
</table>
</td>
<td width="680" height="600">
<form action="A_choixfichier.php" method="post">
<table align="center">
<tr>
<td colspan="2" align="center"><b> Choix des fichiers <b></td>
</tr>
<tr><td><br></td></tr>
<tr><td> Fichiers </td>
<td> <input type="file" name="parcourir">
<input type="submit" name="ajouter" value="ajouter">
</td>
</tr>
<tr> <td></td>
<td><?php /*if (!empty($_POST['listeFichiers'])) print_r( $_POST['listeFichiers']); */ ?>
<select name="listeFichiers" size="5">
<?php
if (empty($_POST['tabfichiers']))
{
$tabfichiers=array();
echo '<option value=\"creation\"> -------------- création tableau -------------- </option>';
}
else
{
$tabfichiers=$_POST['tabfichiers'];
echo '<option value=\"ajout\"> -------------- ancien tableau -------------- </option>';
}
if (!empty($_POST['parcourir']))
array_push ($tabfichiers, $_POST['parcourir']);
$selectfichier='';
while (list($numero, $nom) = each($tabfichiers))
$selectfichier .= '<option value=\"' . $numero . '\">' . $nom . '</option>';
if ($selectfichier=='' )
$selectfichier = '<option value=\"vide\"> -------------- liste vide -------------- </option>';
echo $selectfichier;
?>
</select>
</td>
</tr>
<tr align="right">
<td></td>
<td><input type="reset" name="cmdRAZ" value="Remise à zéro">
<input type="button" name="cmdUpload" value="Télécharger"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>