Código :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Documento sin título</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- .Estilo3 {color: #FF0000} --> </style> </head> <? $db = mysql_connect("localhost","root","") or die ("Unable to connect to MySQL server."); $datos=mysql_select_db ("proyectodb",$db); $consulta= "SELECT * from usuario WHERE usuario='Admin'"; $result =mysql_query($consulta,$db) or die(header ("No se pudo realizar la consulta")); while ($row = mysql_fetch_array($result)) { $codver1=$row['codver']; $usuario1=$row['usuario']; $email1=$row['email']; $sexo1=$row['sexo']; $nombre1=$row['nombre']; $apepat1=$row['apepat']; $apemat1=$row['apemat']; $dni1=$row['dni']; $telefo1=$row['telefo']; $dire1=$row['dire']; $cuidad1=$row['cuidad']; $provin1=$row['provin']; $depa1=$row['depa']; $insti1=$row['insti']; $cargo1=$row['cargo']; $como1=$row['como']; //value="<?php echo $usuario } ?> <body> <form method="post" action="prueba.php?act=acepta"> <div align="center"> <table width="860" border="1"> <tr> <td width="201">Cod Ver </td> <td width="643"><input name="veri" type="text" readonly="true" value= <?php echo $codver1 ?>></td> </tr> <tr> <td>Email</td> <td><span class="Estilo3"> <input name="email" type="text" size="50" value= <?php echo $email1 ?> > </span></td> </tr> <tr> <td>Sexo</td> <td><label> <input name="sexo" type="radio" value="hombre" <?php if ( $sexo1== 'hombre') echo "checked"?>> Hombre</label> <input name="sexo" type="radio" value="mujer" <?php if ( $sexo1== 'mujer') echo "checked"?>> Mujer</td> </tr> <tr> <td>Nombres</td> <td><span class="Estilo3"> <input name="nombre" type="text" id="nombre" readonly="true" size="50" value= <?php echo $nombre1 ?> > </span></td> </tr> <tr> <td>Apellido Parterno </td> <td><span class="Estilo3"> <input name="apepat" type="text" readonly="true" size="35" value= <?php echo $apepat1 ?>> </span></td> </tr> <tr> <td>Apellido Materno </td> <td><span class="Estilo3"> <input name="apemat" type="text" readonly="true" size="35" value = <?php echo $apemat1 ?>> </span></td> </tr> <tr> <td>DNI</td> <td><span class="Estilo3"> <input name="dni" type="text" size="8" value= <?php echo $dni1 ?>> </span></td> </tr> <tr> <td>Telefonos:</td> <td><span class="Estilo3"> <input name="telefono" type="text" id="telefono" size="35" value = <?php echo $telefo1 ?>> </span></td> </tr> <tr> <td>Direccion</td> <td><span class="Estilo3"> <input name="direccion" type="text" id="direccion" size="50" value = <?php echo $dire1 ?>> </span></td> </tr> <tr> <td>Cuidad</td> <td><span class="Estilo3"> <input name="cuidad" type="text" size="30" value = <?php echo $cuidad1 ?>> </span></td> </tr> <tr> <td>Provincia</td> <td><span class="Estilo3"> <input name="provincia" type="text" id="provincia" size="30" value = <?php echo $provin1 ?>> </span></td> </tr> <tr> <td>Departamento:</td> <td><span class="Estilo3"> <input name="departamento" type="text" id="departamento" size="30" value = <?php echo $depa1 ?>> </span></td> </tr> <tr> <td colspan="2">De la instiucion</td> </tr> <tr> <td>Instituxcion Proveniente </td> <td><span class="Estilo3"> <input name="institucion" type="text" id="institucion" size="50" value = <?php echo $insti1 ?>> </span></td> </tr> <tr> <td>Cargo</td> <td><span class="Estilo3"> <input name="cargo" type="text" id="cargo" size="50" value = <?php echo $cargo1 ?>> </span></td> </tr> <tr> <td>Otro</td> <td> </td> </tr> <tr> <td>Como se entero </td> <td><span class="Estilo3"> <input name="como" type="text" id="como" size="50" value = <?php echo $como1 ?>> </span></td> </tr> <tr> <td><input type="submit" name="Submit" value="Actualizar"></td> <?php //-mysql_free_result($consulta); //-mysql_close(); ?> <td><?php if ($_GET['act']=="acepta"){ //-if ( isset ( $_POST['submit'] ) ){ $veri1=$_POST['veri']; $nombres1=$_POST['nombre']; $apepat1=$_POST['apepat']; $apemat1=$_POST['apemat']; $dni1= $_POST['dni']; $mail1=$_POST['email']; $telefono1= $_POST['telefono']; $direccion1=$_POST['direccion']; $departamento1=$_POST['departamento']; $provincia1=$_POST['provincia']; $cuidad1=$_POST['cuidad']; $sexo1= $_POST['sexo']; $institucion1=$_POST['institucion']; $cargo1=$_POST['cargo']; $como1=$_POST['como']; $db = mysql_connect("localhost","root",""); mysql_select_db (proyectodb); $result = mysql_query ("SELECT usuario FROM usuario WHERE codver = '$veri1'"); if(mysql_num_rows($result)==0){ //- header("Location: verificar_user.php"); //- exit(); echo "NO encontro resultados"; }else{ if(strlen($nombres1)==0 || strlen($apepat1)==0 || strlen($apemat1)==0 || strlen($dni1)==0 || strlen($mail1)==0 || strlen($direccion1)==0 || strlen($cuidad1)==0 || strlen($provincia1)==0 || strlen($departamento1)==0 || strlen($institucion1)==0 || strlen($cargo1)==0 || strlen($como1)==0) { header("Location: adduser.php?var=$veri1"); } } if(mysql_num_rows($result)!=0) { //-$actualizo1=1; //1 = ya actualizo sus datos mysql_query("UPDATE usuario SET nombre='$nombres1', apepat='$apepat1', apemat='$apemat1', dni='$dni1', email='$mail1',sexo='$sexo1',telefo='$telefono1', dire='$direccion1', cuidad='$cuidad1', provin='$provincia1', depa='$departamento1',insti='$institucion1',cargo='$cargo1', como='$como1' WHERE codver='$veri1'"); mysql_close($db); } }?></td> </tr> </table> </div> </form> </body> </html>