Ver Mensaje Individual
  #62 (permalink)  
Antiguo 13/11/2011, 02:21
webankenovi
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: formulario insert y consulta de otra tabla

Código PHP:
Ver original
  1. <html>
  2. <head>
  3. <title>Problema</title>
  4. </head>
  5. <body>
  6. <form action="2.php" method="post">
  7. Ingrese nombre:
  8. <input type="text" name="nombre"><br>
  9. Ingrese mail:
  10. <input type="text" name="mail"><br>
  11.  
  12. Seleccione el curso:
  13. <?php
  14. $conexion=mysql_connect("localhost","root","esme25") or
  15. die("Problemas en la conexion");
  16. mysql_select_db("phpfacil",$conexion) or
  17. die("Problemas en la selección de la base de datos");
  18. $registros=mysql_query("select codigo,nombrecur from cursos2",$conexion) or
  19. die("Problemas en el select:".mysql_error());
  20. while ($reg=mysql_fetch_array($registros)){
  21. ?>
  22.  
  23.  
  24. <input type ="radio" name="codigocurso" value="<?php echo $reg['codigo'];?>"><?php echo $reg['nombrecur'];?><br>
  25.  
  26. <?php }?>
  27. <input type="submit" value="Registrar">
  28. </form>
  29. </body>
  30. </html>