pues tengo le siguiente script que sube varios archivos a la vez al servidor segun lo indique el usuario:
Código PHP:
if ($opcion == "imagenanadir")
{
print "<TD VALIGN=TOP ALIGN=CENTER WIDTH=100%>
<form action=\"index.php?opcion=cuantas\" method=\"post\">
<table cellspacing=0 cellpadding=0 border=0 width=500>
<tbody>
<tr>
<td valign=top align=center><font size=2 face=verdana color=#454545>Cuantas imagenes deseas subir:</font></td>
</tr></tbody></table><br>
<table cellspacing=0 cellpadding=0 border=0 width=250 align=center>
<tbody>
<tr>
<input type=\"hidden\" name=\"central\" value=\"$central\">
<input type=\"hidden\" name=\"vercode\" value=\"$vercode\">
<td valign=top align=right><input type=\"text\" name=\"cuantas\" size=\"25\"></td>
<td valign=top align=left> <input type=\"submit\" value=\"Enviar\"></td>
</tr></tbody></table>
</form>
</TD>";
}
if ($opcion == "cuantas")
{
print "<TD VALIGN=TOP ALIGN=CENTER WIDTH=100%>
<table cellspacing=0 cellpadding=0 border=0 width=500>
<tbody>
<tr>
<td valign=top bgcolor=#66CCCC align=center><font size=2 face=verdana color=#FFFFFF><b>Subiendo Imagenes:</b></font></td>
</tr></tbody></table><br>
<form enctype=\"multipart/form-data\" action=\"index.php?opcion=subiendo\" method=\"post\">
<table cellspacing=0 cellpadding=0 border=0 width=500 align=center>
<tbody>";
for ($g=0; $g<$cuantas; $g++)
{
print "<tr>\r<td valign=top align=center><input type=\"file\" name=\"imagen$g\" size=\"34\"></td>";
}
print "\r<input type=\"hidden\" name=\"central\" value=\"$central\">
<input type=\"hidden\" name=\"vercode\" value=\"$vercode\">
<input type=\"hidden\" name=\"cuantas\" value=\"$cuantas\">
</tr></tbody></table><br>
<table cellspacing=0 cellpadding=0 border=0 width=500>
<tbody>
<tr>
<td valign=top align=center><input type=\"submit\" value=\"Enviar\"></td>
</tr></tbody></table>
</form>
</TD>";
}
if ($opcion == "subiendo")
{
for ($gg=0; $gg<$cuantas; $gg++)
{
$imagen = "imagen$gg";
$imagen = ${$imagen};
if ($imagen[$gg] != "")
{
$nombre = "imagen".$gg."_name";
$nombre = ${$nombre};
$fp = fopen ("../$central/fileimagenes/$vercode.txt","w");
fwrite($fp, $nombre);
fclose($fp);
$imagen_destino = ("../$central/fileimagenes/".$nombre);
copy("$imagen", "$imagen_destino");
}
}
print "subi las imagenes xD";
}
el bendito problema

es que me sube correctamente las imagenes
PERO no me guarda en el archivo de texto los nombres de las imagenes subidas... alguien me podria hechar la mano a decirme cual es el error

osea si me pone el nombre de las imagenes
PERO no mas el de una, ejemplo si subi dos imagenes no mas me guarda el nombre de la primera imagen y no importa cuantas suba, no mas me guarda el primer nombre...
saLudOs