Ver Mensaje Individual
  #3 (permalink)  
Antiguo 29/10/2013, 05:18
cristiangd00
 
Fecha de Ingreso: octubre-2013
Ubicación: Asturias
Mensajes: 52
Antigüedad: 11 años, 3 meses
Puntos: 1
Respuesta: Funcion en un select

Código HTML:
Ver original
  1.  
  2.     <head>
  3.         <title>Formulario para realizar nuevo pedido</title>
  4.     </head>
  5.    
  6.     <body>
  7.         <form name="form_pedidos" method="post">
  8.         <fieldset>
  9.         <legend>Nuevo Pedido</legend>
  10.          
  11.             <p>Referencia del pedido : <input type="text" name="referencia_pedido" /><br></p>
  12.             <p>Fecha del pedido : <input type="date" name="fecha " /><br></p>
  13.             <p>Proveedor
  14.             <select name="referencia_proveedor">
  15.             <option
  16.            <?php
  17.            leer_proveedores();
  18.            ?>>
  19.             </option>
  20.            
  21.            
  22.             </select>
  23.            
  24.             <input type="submit" value="Registrar" />
  25.        
  26.         </fieldset>
  27.        
  28.         </form>
  29.  
  30.  
  31.  
  32.     </body>
  33.  
  34. </html>
[
Código PHP:
Ver original
  1. <?php  session_start();
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  include ('funciones.php');
  8.  
  9. if(!empty ($_POST['referecia_pedido']) && !empty ($_POST['fecha']) && !empty ($_POST['referencia_proveedor'])){  
  10.  
  11.  
  12.  
  13. $_SESSION['referencia_pedido']=$_POST['referecia_pedido'];
  14. $_SESSION['fecha']=$_POST['fecha']=$_POST['fecha'];
  15. $_SESSION['referencia_proveedor']=$_POST['referencia_proveedor'];
  16.  
  17.  
  18. echo 'llega<br>';
  19. if(insertar_pedidos($_SESSION['referencia_pedido'],$_SESSION['fecha'],$_SESSION['referencia_proveedor'])){
  20. echo 'llega2<br>';
  21. echo 'Pedido insertado con éxito <br>';
  22.  
  23.  
  24.  
  25.  
  26. echo '<a href="index.php">Acceder </a>';
  27.  
  28. }else
  29.    
  30.     echo 'Pedido no creado';
  31.  
  32.  
  33.  
  34. }else echo '';
  35.  
  36.  
  37.  
  38. ?>

Última edición por cristiangd00; 29/10/2013 a las 06:10