Ver Mensaje Individual
  #7 (permalink)  
Antiguo 07/06/2012, 13:59
towi62
 
Fecha de Ingreso: abril-2005
Mensajes: 253
Antigüedad: 19 años
Puntos: 0
Respuesta: como insertar datos en tabla mysql si los datos son correctos

lo he conseguido y un ejemplo quedaría así:
procesa.php
Código PHP:
Ver original
  1. <html>
  2. <head>
  3.     <title>Me llamo a mi mismo...</title>
  4. </head>
  5.  
  6. <body>
  7. <?
  8. if (!$_POST){
  9. ?>
  10.     <form action="prueba.php" method="post">
  11.     Nombre: <input type="text" name="nombre" size="30">
  12.     <input type="submit" value="Enviar">
  13.     </form>
  14. <?
  15. }else{
  16.    
  17.    
  18.    $a= $_POST["nombre"];
  19.    echo "Su nombre: $a";
  20.  
  21.  
  22. echo '
  23. <form action="envia.php" method="post" enctype="multipart/form-data" id="form1" name="form1">
  24. <input type="hidden" name="nombre" value="'.$a.'"/>
  25. </p>
  26. <p>
  27. <input type="submit" name="button" id="button" value="Enviar" />
  28. </p>
  29.  
  30. ';
  31. }
  32.  
  33. ?>
  34. </body>
  35. </html>
envia.php
Código PHP:
Ver original
  1. <?php
  2.  
  3. /**
  4.  * @author ohyeah
  5.  * @copyright 2012
  6.  */
  7.  
  8.     echo "<br>Su nombre: " . $_POST["nombre"];
  9.    
  10.     //.....aqui poner las lineas que van hacer que envien los valores a la tabla...
  11. ?>

Muchas grasias a los que me ayudaron con este tema.
__________________
:cool: aprendiz :cool: