PHP - Como recibir informacion modificable

 
Vista:
sin imagen de perfil

Como recibir informacion modificable

Publicado por jose luis (2 intervenciones) el 13/12/2017 21:29:54
Buenas estoy intentando recibir informacion modificable de mysql alguien puede decirme que me falta o esta mal, soy nuevo en php. Comentar que tengo antes de este archivo uno donde tengo un boton llamao modificar.php que me lleva hasta este donde quiero hacer la modificacion pero she intentado varias cosas y me dice que no esta indefinida la variable o otros errores. Adjunto codigo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
require_once("header.inc");
?>
 
 
<html>
    <head>
        <meta charset="UTF-8">
        <link rel="stylesheet" type="text/css" href="estilo.css" >
        <title>Forrare Bank</title>
        <style>
            .resultado th tr td {
                border: solid 1px black;
            }
        </style>
    </head>
    <body>
           <h1 class="centrado">Forrare Bank</h1>
           <h2 class="centrado">José Luis Cerezo Marin</h2>
 
           <form name="formulario" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
 
               <fieldset class="menu">
 
 
                  <input type="button" value="Nuevo usuario" onClick=" window.location.href='nuevo.php' ">
                  <input type="button" value="Modificar usuario" onClick=" window.location.href='modificar.php' ">
	          <input type="button" value="Borrar usuario" onClick=" window.location.href='borrar.php' ">
	          <input type="button" value="Salir" onClick=" window.location.href='index.php' ">
 
               </fieldset>
 
           </form>
 
           <table border="2">
 
               <?php
                   $usuario=null;
                   $usuario=$_POST['usuario'];
                  $query=' select * from usuarios where login =\''.$usuario.'\'';
                  $resultado = $conexion->query($query);
                  while($row=$resultado->fetch()){
                  ?>
                <tr>
                  Login:<input type="text" name="login" value="<?php echo $row['login'];?>" placeholder="Login" readonly="readonly" ><br>
                  Password:<input type="text" name="password" value="<?php echo $row['password'];?>" placeholder="Password"   required><br>
                  Repetir password:<input type="text" name="Pass2" placeholder="Repetir password" value="<?php echo $row['password']?>" required><br>
                  Nombre:<input type="text" id="nombre" name="nombre" placeholder="Nombre" value="<?php echo $row['nombre'];?>" required><br>
                  Fecha de nacimiento:<input type="text" id="fNacimiento" name="fNacimiento" placeholder="Fecha de nacimiento" value="<?php echo $row['fNacimiento'];?>" required><br>
                   <input type="submit" name="aceptar" value="Aceptar cambios"/>
                </tr>
 
                  <?php
                  }
 
     	    ?>
           </table>
    </body>
</html>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder