Ver Mensaje Individual
  #29 (permalink)  
Antiguo 04/01/2010, 19:11
carlosalas
 
Fecha de Ingreso: enero-2010
Mensajes: 44
Antigüedad: 14 años, 4 meses
Puntos: 0
Respuesta: Selección de usuario y enviar

Me interesa el tema. Estoy intentando hacer un select con los usuarios de mi página.

Inicio con select y debajo de él un formulario.


Código:
<?php
include('db.php');

echo '<form action="adding.php" method="POST">

<select size="10">
    <option value="" selected="selected">Seleccione un nombre</option>
    <?php
        $sql="SELECT id, nombre FROM users ORDER BY nombre;";
        $resultSet=mysql_query($sql);
        while($fila=mysql_fetch_array($resultSet))
        {
            echo "<option value=\"".$fila['id']."\">".$fila['nombre']."</option>";
        }
    ?>
</select>

Nombre: <br><input type="text" name="nombre" size="10"><br>

Usuario: <br><input type="text" name="username" size="10"><br>

Contraseña: <br><input type="password" name="password" size="10" ><br>

E-mail: <br><input type="text" name="email" size="50"><br><br>

Carro: <br><input type="text" name="car" size="10"><br>

<input type="submit" name="submit" value="Agregar"></form>';

?>

Por el momento sólo tengo el formulario y adding.php para agregar la info a la BD pero no se como seleccionar al usuario y agregarle a sus campos la información.