Salut
J'éssai de récupérer les valeurs d'un tableau de zone texte, créé de manière dynamique.
Exemple ( <input TYPE="TEXT" name="txtPrix[]" size="55" value=""> )
Voici un bout de code :
Jusque là, tout va très bien, les valeurs de mon fichier sont afficher dans les zones texte.if ($fp = fopen("liste_Prix.txt","r") ) {
while (!feof( $fp )) {
$listprix[$i] = trim(fgets($fp, 4096));
if ( $y == 0 ) {
echo '<TR><TD WIDTH="16%" VALIGN="TOP" HEIGHT="21">';
echo '<input TYPE="TEXT" name="txtPrix[]" size="10" value="' . $listprix[$i] . '"></TD>';
} else if ( $y == 1 ) {
echo '<TD WIDTH="67%" VALIGN="TOP" HEIGHT="21">';
echo '<input TYPE="TEXT" name="txtPrix[]" size="55" value="' . $listprix[$i] . '"></TD>';
} else if ( $y == 2 ) {
echo '<TD WIDTH="17%" VALIGN="TOP" HEIGHT="21">';
echo '<input TYPE="TEXT" name="txtPrix[]" size="10" value="' . $listprix[$i] . '"></TD></TR>';
}
$y++;
if ($y >= 3) { $y=0; }
$i++;
}
fclose($fp);
}
Le problème, c'est la récupération de valeurs après modification :
Voici mon exemple qui ne fonctionne pas !
Alors si vous avez une solution a mon prioblème, je vous serais très reconnaicent !if ( isset($_POST['Fermer']) ) {
for ($y=0; $y<count($txtPrix); $y ++) {
$listprix[$y] = $txtPrix[$y];
// Ici les valeurs sont comme inexistantes ! pourquoi ???
echo $txtPrix[$y];
}
}
Merci a tous !
Gilles
Partager