Bonjour,
J'ai 2 formulaire différents qui contienne les même champs.
J'aimerais savoir comment faire pour que lorsque je clique sur un bouton submit, il charge une certaine page (contenant toute les infos dans les champs) mais si je clique sur le 2ème bouton submit, il charge une autre page toujours en contenant les même informations.
comment faire?
voici mon code :
<form method="POST" action="?page=facture">
<form method="POST" action="">
<table>
<tr>
<th>Nom</th>
<th>Prix unitaire</th>
<th>Quantité</th>
<th>Prix total</th>
</tr>
<?php
while (isset($_SESSION['compteur'.$n]))
{
?>
<tr>
<td><?php echo $_SESSION['nom_produit'.$n];?></td>
<td><?php echo $_SESSION['prix'.$n].' €';?></td>
<td><?php echo '<input type="text" style="text-align:center;" class="formulaire" name="nombre_produit' . $numLine . '" value="'.$_SESSION['nbr_achat'.$n].'" />';?></td>
<td><?php echo $_SESSION['prix'.$n] * $_SESSION['nbr_achat'.$n].' €';?></td>
<td><a href="?page=commander&mod=<?php echo $_SESSION['id_produit'.$n];?>"></a></td>
</tr>
<?php
$prix = $_SESSION['prix'.$n] * $_SESSION['nbr_achat'.$n];
$prixtot = $prix + $prixtot;
//Incrémentation
$numLine++;
$n++;
}
?>
<tr>
<td></td>
<td><input type="submit" name="recalculer" value="recalculer" /></td>
<td>Total :</td>
<td><?php echo $prixtot.' €';?></td>
<tr>
</form>
<tr>
<td colspan="5"><input type="submit" name="valider" value="valider" /></td>
</tr>
</table>
</form>
L'amour, c'est comme les spaghettis; quand c'est mou, c'est cuit. (proverbe belge)