Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/09/2004, 12:11
catrin
 
Fecha de Ingreso: julio-2003
Mensajes: 53
Antigüedad: 20 años, 9 meses
Puntos: 0
Modificar registros

Hola una vez mas.

Quiero actualizar regsitros de una db, quiero que para la persona seleccione un ususario y según este me muestre una tabla con sus datos y que luego aparezca un formulario para ingresar los nuevos datos, pero que exista un dato no modificable en el formulario, lo que no me funciona es que en el campo del formulario aparezca el valor.

Espero me hayan entendido.
Este es el script.
<HTML>
<HEAD>
<TITLE>Actualizarusuarios.php</TITLE>
</HEAD>
<BODY>
<div align="center">
<h1>Actualizar un registro</h1>
<br>
<?
//Conexion con la base
mysql_connect("localhost","root","root");

//Creamos la sentencia SQL y la ejecutamos
$sSQL="Select * From password where login='$login'";
?>
<table align ="center" border="2" bordercolor="blue">
<tr>
<th>Nombre</th>
<th>Apellidos</th>
<th>Rut</th>
<th>Login</th>
<th>Password</th>
<th>email</th>
<th>general</th>
<th>administracion</th>
<th>Recaudación</th>
<th>Abastecimiento</th>
<th>Ingenieria</th>
<th>SSGG</th>
<th>Gerencia</th>
<?
$result=mysql_db_query("gestion",$sSQL);
while ($row=mysql_fetch_array($result))
{
echo '<tr><td>'.$row ["nombre"].'</td>';
echo '<td>'.$row ["apellidos"].'</td>';
echo '<td>'.$row ["rut"].'</td>';
echo '<td>'.$row ["login"].'</td>';
echo '<td>'.$row ["password"].'</td>';
echo '<td>'.$row ["email"].'</td>';
echo '<td>'.$row ["general"].'</td>';
echo '<td>'.$row ["administracion"].'</td>';
echo '<td>'.$row ["gestionadrec"].'</td>';
echo '<td>'.$row ["gestionabastecimiento"].'</td>';
echo '<td>'.$row ["gestioningenieria"].'</td>';
echo '<td>'.$row ["gestionssgg"].'</td>';
echo '<td>'.$row ["presupuestogerencia"].'</td></tr>';
}
?>
</table>
<br>
<div align="center">
<h1>Datos a Modificar</h1>

<FORM METHOD="POST" ACTION="actualizarusuario.php">
<?
//Conexion con la base
mysql_connect("localhost","root","root");
//Creamos la sentencia SQL y la ejecutamos
$sSQL="Select rut From password where login='$login'";
$result=mysql_db_query("gestion",$sSQL);
while ($row=mysql_fetch_array($result))
?>
<B>Nombre:</B> <input type="text" name="nombre" size="30"/><br>
<B>Apellidos:</B> <input type="text" name="apellidos" size="30"/><br>
<B>Rut:</B> <input type="text" name="rut" value="<? print $row[rut] ?>" size="30"/><br>
<B>Login:</B><input type="text" name="login" size="30"/><br>
<B>Password:</B> <input type="text" name="password" /><br>
<B>E-mail:</B> <input type="text" name="email" /><br>

<B>* Permisos de acceso :</B><br>

<input type="checkbox" name="general" /> <B>General<br>
<input type="checkbox" name="administracion" /> <B>Administración Usuarios</B> <br>
<input type="checkbox" name="gestionadrec" /> <B>Gestion Admisión y Recaudación</B><br>
<input type="checkbox" name="gestionabastecimiento" /> <B>Gestión Abastecimiento</B> <br>
<input type="checkbox" name="gestioningenieria" /> <B>Gestión Ingeniería </B><br>
<input type="checkbox" name="gestionssgg" /> <B>Gestión Servicios Basicos </B><br>
<input type="checkbox" name="presupuestogerencia" /> <B>Gerencia Hospital </B> <br>
<br>
<INPUT TYPE="submit" value="Actualizar">
</form>

<a href="lecturausuarios2.php">Volver</a>

</div>
</BODY>
</HTML>

Si pueden ayudarme, o darme una idea mejor.
Se los agradeceria mucho.
Saludos.