
08/04/2008, 15:35
|
| | Fecha de Ingreso: febrero-2004
Mensajes: 47
Antigüedad: 21 años Puntos: 0 | |
Re: Problema serio al actualizar un registro Hola yoseman:
ojala y no sea una impertinencia el preguntarte algunas dudas que tengo.
como te dije enel mensaje anterior, ya resolvi lo de subir los archivos a una carpeta del servidor desde el formulario, pero resulta que yo quisiea mejorarlo pues tengo el siguiente problema:
cuando llamo al formulario, leo si existe un nombre de fichero asignado a un pampo en la BD, si existe me muestra el nombre y la foto correspondiente.
ahora bien, yo tengo tres campos para guardar los nombres de tres ficheros que se pueden subir.
si ya he subido un fichero y despues (en otro momento) quiero subir otro fichero pues me quedan dos posibilidades mas, resulta que como no escribi nada en el primer campo del formulario de fichero pues ya tiene uno asignado en la BD, cuando le doy al boto de subir los archivos, resulta que me borra de la BD el nombre de fichero que habia en el primer campo y me sube y guarda los dos restantes, me entiendes?
aqui te envio el codigo completo del formulario a ver si me ayudas con ese problemita.
saludos
PCMAC
<form action="<?php echo $editFormAction; ?>" method='POST' enctype="multipart/form-data" name='formulario' id='formulario'><br />
<br />
<table width="779" border="0">
<tr class="Estilo2">
<td width="140">Insertar Imágenes</td>
<td width="441" class="Estilo2"> </td>
<td width="184" class="Estilo2"> </td>
</tr>
<tr class="Estilo2">
<td> </td>
<td>Fichero actual:
<input name="foto1" type="text"id="foto1" value="<?php if (isset($_POST['foto1'])) {
echo htmlentities($_POST['foto1']);
} else {
echo htmlentities($row_Recordset1['foto1']);}
?>" size="37"/>
<br />
Nuevo fichero:
<input name="foto1" type="file" id="foto1" value="<?php echo $row_Recordset1['foto1']; ?>" /></td>
<td>
<?php if ($row_Recordset1['foto1'] <>''){?>
<a href="archivos/<?php echo $row_Recordset1['foto1']; ?>" target="_blank"> <img src="archivos/<?php echo $row_Recordset1['foto1']; ?>" width="100" height="100" /></a>
<?php } ?>
</td>
</tr>
<tr class="Estilo2">
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr class="Estilo2">
<td> </td>
<td>Fichero actual:
<input name="foto2" type="text"id="foto2" value="<?php if (isset($_POST['foto2'])) {
echo htmlentities($_POST['foto2']);
} else {
echo htmlentities($row_Recordset1['foto2']);}
?>" size="37"/>
<br />
Nuevo fichero:
<input name="foto2" type="file" id="foto2" value="<?php echo $row_Recordset1['foto2']; ?>" /></td>
<td>
<?php if ($row_Recordset1['foto2'] <>''){?>
<a href="archivos/<?php echo $row_Recordset1['foto2']; ?>" target="_blank"> <img src="archivos/<?php echo $row_Recordset1['foto2']; ?>" width="100" height="100" /></a>
<?php } ?>
</td>
</tr>
<tr class="Estilo2">
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr class="Estilo2">
<td> </td>
<td>Fichero actual:
<input name="foto4" type="text"id="foto4" value="<?php if (isset($_POST['foto3'])) {
echo htmlentities($_POST['foto3']);
} else {
echo htmlentities($row_Recordset1['foto3']);}
?>" size="37"/>
<br />
Nuevo fichero:
<input name="foto3" type="file" id="foto3" value="<?php echo $row_Recordset1['foto3']; ?>" /></td>
<td>
<?php if ($row_Recordset1['foto3'] <>''){?>
<a href="archivos/<?php echo $row_Recordset1['foto3']; ?>" target="_blank"> <img src="archivos/<?php echo $row_Recordset1['foto3']; ?>" width="100" height="100" /></a>
<?php } ?>
</td>
</tr>
<tr class="Estilo2">
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td><span class="Estilo2">
<input type='submit' value='Actualizar datos' />
</span></td>
<td> </td>
<td> </td>
</tr>
</table>
<br />
<a href="panel_control.php">Volver al Panel de Control</a>
<input name="id" type="hidden" id="id" value="<?php echo $row_Recordset1['id']; ?>" />
<input type="hidden" name="MM_update" value="formulario" />
</form> |