Ver Mensaje Individual
  #3 (permalink)  
Antiguo 08/05/2005, 08:35
CapiCapi
 
Fecha de Ingreso: mayo-2005
Mensajes: 78
Antigüedad: 19 años
Puntos: 0
Seppo, funcionar funciona, esta claro, pero no es solo ese el codigo que tengo. El problema es, que yo relleno los campos anteriores y cuando le doy a añadir autor, pues todos los campos anteriormente rellenados desaparecen... Por ejemplo con este codigo:
<table width="596" border="0">
<tr>
<td width="102" height="100">Resumen:</td>
<td width="484"><textarea name="resumen" cols="75" rows="5"></textarea></td>
</tr>
</table>
<table width="200" border="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="200" border="0">
<tr>
<td><div align="center"><strong><span class="style1">AUTORES</span></strong></div></td>
</tr>
</table>
<table width="608" border="0">
<tr>
<td><? if(isset($_POST["AnyadirAutor"]))
{
foreach($_POST["nombreAut"] as $nomAut)
{
//echo "<br>DNI: "."$dni";
?>
<input type="hidden" name="nombreAut[]" value="<? echo $nomAut; ?>" >
<tr><td>AUTOR: </td><td><? echo $nomAut; echo "<br>"; ?></td></tr>
<?
}
}
?>
</td>
<td width="135">Nombre y Apellidos:</td>
<td width="463"><input type="text" name="nombreAut[]" width="450"></td>
</tr>
</table>
<table width="200" border="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="487" border="0">
<tr>
<td width="481"><div align="right">
<input type="submit" name="AnyadirAutor" value="Añadir Autor">
</div></td>
</tr>
</table>

Si rellenas el area de texto resumen, luego un autor y das a añadir autor, lo que has escrito en resumen desaparece...

El segundo problema, el codigo es:
<form name="form1" method="post" action="ResultadoModificarRegistro.php">
<?
@ $db = mysql_pconnect("localhost", "root");

mysql_select_db("digitalbook");

@ session_start();
$login = $_SESSION['valid_user'];

//$login = "admin";
$datos_reg = "select *from usuario_registrado where login ='".$login."'";
$res_datos_reg = mysql_query($datos_reg);
$num_results = mysql_num_rows($res_datos_reg);
if($num_results == 0)
{
echo "El usuario con login: "."$login"." NO existe";
exit;
}

$row = mysql_fetch_array($res_datos_reg);
$login = $row["login"];
$pass = $row["pass"];
$tipo = $row["tipo"];
$nombre = $row["nombre"];
$apellidos = $row["apellidos"];
$email = $row["email"];
$direccion = $row["direccion"];
$poblacion = $row["poblacion"];
$CP = $row["CP"];
$pais = $row["pais"];
$fecha_nacimiento = $row["fecha_nacimiento"];
if($fecha_nacimiento)
{
$dia=substr($fecha_nacimiento,8,2);
$mes=substr($fecha_nacimiento,5,2);
$anio=substr($fecha_nacimiento,0,4);
$fecha_nacimiento=$dia."-".$mes."-".$anio;
}

$sexo = $row["sexo"];
$telefono = $row["telefono"];
?>

<table width="200" border="0">
<tr>
<td><div align="center"><u><strong><span class="style1">CAMBIAR DATOS </span></strong></u></div></td>
</tr>
</table>
<table width="200" border="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="218" border="0">
<tr>
<td width="61"><span class="Estilo1">*</span> Login: </td>
<td width="147"><input name="login" type="text" disabled="disabled" value= <? echo "$login" ?> ></td>
</tr>
</table>

Lo que hago es conectarme y despues copiar lo he que recuperado en el campo de texto correspondiente

Última edición por CapiCapi; 08/05/2005 a las 08:42