Ver Mensaje Individual
  #2 (permalink)  
Antiguo 30/01/2015, 08:22
Avatar de Carlos1975
Carlos1975
 
Fecha de Ingreso: mayo-2005
Mensajes: 29
Antigüedad: 19 años, 9 meses
Puntos: 0
Respuesta: Envio de variable en button por URL

Solucionado:

Código HTML:
Ver original
  1. <form method="POST" name="form" id="form" action="actions/productos_save_new.php" >
  2.      
  3.     <!-- campos correspondientes -->
  4.      
  5.      
  6.     <button type="submit" name="save" value="0"><i class="icon-save"></i><br />Guardar producto</button>
  7.      
  8.     <button type="submit" name="save" value="1"><i class="icon-save"></i><br />Guardar y permanecer</button>
  9.      
  10.     </form>

Código PHP:
Ver original
  1. if ($_POST["save"] == 0) {
  2.  
  3. // intrucciones
  4.  
  5. }
  6.  
  7. if ($_POST["save"] == 1) {
  8.  
  9. // intrucciones
  10.  
  11. }