PHP: Gérer un formulaire multipage

Author:

 formulaire
Download

 
<?php
 
  /*
  Pour tester, créer chaque page dans un fichier different
 
  */
 
?>
<html>
<body>
<div>
<form action="page2.php" method="post">
 
Page 1/4
<input type="hidden" name="submitted" value="yes" />
votre nom:
<input type="text" name="nom" maxlength="150" />
<input type="submit" value="Submit" style="margin-top: 10px;" />
</form>
</div>
 
</body>
</html>
 
------------------ Page2------------------------------
<html>
<body>
<div>
<form action="page3.php" method="post">
 
Page 2/4
 
Votre Pays:
<select name="pays">
<option value="nogo">Choisissez un élément...</option>
<option value="France">France</option>
<option value="Espagne">Espagne</option>
<option value="Portugal">Portugal</option>
</select>
<input type="hidden" name="nom" .
value="<?php echo $_POST['nom']; ?>" />
<input type="submit" value="Submit" style="margin-top: 10px;" />
</form>
</div>
 
</body>
</html>
------------------ Page3--------------------------------------
 
<html>
<body>
<form action="page4.php" method="post">
 
Page 3/4:
 
Votre Email:
<input type="text" name="email" maxlength="150" />
<input type="hidden" name="nom".
value="<?php echo $_POST['nom']; ?>" />
<input type="hidden" name="pays".
value="<?php echo $_POST['pays']; ?>" />
<input type="submit" value="Envoyer"/>
</form>
 
</body>
</html>
 
-------------------Page4-----------------------------------
<html>
<body>
 
Fin d'inscription, veillez vérifier vos informations
 
<?php
echo "Nom: " . $_POST['nom'] . "";
echo "pays: " . $_POST['pays'] . "";
echo "Email: " . $_POST['email'] . "";
?>
<a href="page1.php">Recommencer?</a>
</body>
</html>

Leave a Reply

Your email address will not be published. Required fields are marked *


× four = 20