Ver Mensaje Individual
  #4 (permalink)  
Antiguo 12/09/2011, 18:06
Avatar de TheScript
TheScript
 
Fecha de Ingreso: septiembre-2011
Ubicación: Spain
Mensajes: 164
Antigüedad: 12 años, 7 meses
Puntos: 30
Respuesta: Duda con (if: else: endif; )

Hola a todos, no consigo hacer que finalice el formulario y pueda guardar los datos, cuando termino el segundo paso, vuelve a mostrarme el primer paso, y asi todo el rato...

lo he simplificado para poder ver que es lo que ocurre, pero no tengo ni idea!! ¿Por qué no termina nunca?

Código PHP:
<body>
<?php 
$nombre 
"";
$apellidos "";

if(isset(
$_POST['continuar'])){ 
    
$nombre = ($_POST['nombre']);
    
$status 1;
}

if(isset(
$_POST['finalizar'])){ 
    
$apellidos = ($_POST['apellidos']);
    
$status_2 1;
}

?>

<?php if(!isset($status)): ?>

<form action="prueba_step.php"  method="post">
 nombre<input type="text" name="nombre" value="" size="20">
 <input type="submit" value="Continuar" name="continuar" >
</form>

<?php else: ?>

<?php if(!isset($status_2)): ?>

<form action="prueba_step.php"  method="post">
 apellidos<input type="text" name="apellidos" value="" size="20">
 <input type="submit" value="Finalizar" name="finalizar" >
</form>

<?php else: ?>
<?php 
echo $nombre.$apellidos?>


    <?php endif; ?>
            <?php endif; ?>



</body>