Ver Mensaje Individual
  #5 (permalink)  
Antiguo 15/07/2009, 09:10
thezzin
 
Fecha de Ingreso: septiembre-2008
Mensajes: 350
Antigüedad: 15 años, 8 meses
Puntos: 31
Respuesta: Formulario con 2 botones

aquí te dejo este código

Código HTML:
<form action="pagina1.php" method="post" name="p2">
<input name="a" type="text" /><br />
<input name="b" type="text" /><br />
<input type="submit" value="pagina 1" onclick="this.form; return true;">
<input type="submit" value="pagina 2" onclick="p2.action='pagina2.php'; return true;"> 
</form> 
si usas el M FireFox y presionas un botón y haces un back y presionas el otro te envía a la misma pagina.
pero si haces un Reload no
o lo que puedes hacer es un target='_blank
onclick="this.form.target='_blank';return true;">

y aquí el php code este lo puedes usar en las dos paginas y tendrás el mismo resultado
Código PHP:
<?php
if(isset($_POST['a'])){
echo 
$_POST['a'].'<br />';
echo 
$_POST['b'];
}
?>
__________________
╬-----╬
║☺₧☻║
╬-----╬