How to make form in stages?

-2

I am creating a system and wanted to know how to make a form per step, it works by checkbox and input and type just wanted to know how to pass the data from the first form to the two to be inserted into mysql.

</tr>
    <tr>
    <td width="280" bgcolor="#00BFFF">Refeição</td>
	<td width="70" bgcolor="#00BFFF">Quantidade</td>
	
    </tr>

	<tr>
		<td width="280"><input type="checkbox" name="pedido_refeicao[]" value="Costela de Tambaqui sem Espinha">Costela de Tambaqui sem Espinha</td>
		<td width="20"><input type="text" name="num_refeicao[]" size="7"></td>
		
	</tr>
	<tr>
		<td width="280"><input type="checkbox" name="pedido_refeicao[]" value="Lombo de Tambaqui Frito sem Espinha">Lombo de Tambaqui Frito sem Espinha</td>
		<td width="20"><input type="text" name="num_refeicao[]" size="7"></td>
	
	</tr>
		<tr>
		<td width="280"><input type="checkbox" name="pedido_refeicao[]" value="Caldeirada de Tambaqui sem Espinha">Caldeirada de Tambaqui sem Espinha</td>
		<td width="20"><input type="text" name="num_refeicao[]" size="7"></td>

 
</table>
 <br>
<input class="btn" type="submit" value="Proximo" name="Proximo"> 
</form>

And on page two of the form is the bottom one but in the first step of the form work with checkbox and how will I select several of them I will have to use the implode to get all the checkboxes and input how could I do? Thanks in advance

     if($_POST)
    {  
        $numero_mesa = $_POST['numero_mesa'];
        $pedido_refeicao = implode(', ', $_POST['pedido_refeicao']);
        $num_refeicao = implode(', ', $_POST['num_refeicao']);
}





<?php

session_start();

$nome = isset($_POST['nome']) ? $_POST['nome'] : '';
$_SESSION['nome'] = $nome;

$email = isset($_POST['email']) ? $_POST['email'] : '';
$_SESSION['email'] = $email;

$telefone = isset($_POST['telefone']) ? $_POST['telefone'] : '';
$_SESSION['telefone'] = $telefone;

?>
    
asked by anonymous 27.01.2017 / 01:57

1 answer

-2

I do not know if this is what you want, but I think you have to open form as follows:

  

Where it is written formulario2 would be your PHP page you created to give insert in MySQL with PHP.

<form action="formulario2.php"  method="post">
    <table>
        <tr>
            <td width="280" bgcolor="#00BFFF">Refeição</td>
            <td width="70" bgcolor="#00BFFF">Quantidade</td>
        </tr>

        <tr>
            <td width="280"><input type="checkbox" name="pedido_refeicao[]" value="Costela de Tambaqui sem Espinha">Costela de Tambaqui sem Espinha</td>
            <td width="20"><input type="text" name="num_refeicao[]" size="7"></td>
        </tr>
        <tr>
            <td width="280"><input type="checkbox" name="pedido_refeicao[]" value="Lombo de Tambaqui Frito sem Espinha">Lombo de Tambaqui Frito sem Espinha</td>
            <td width="20"><input type="text" name="num_refeicao[]" size="7"></td>
        </tr>
        <tr>
            <td width="280"><input type="checkbox" name="pedido_refeicao[]" value="Caldeirada de Tambaqui sem Espinha">Caldeirada de Tambaqui sem Espinha</td>
            <td width="20"><input type="text" name="num_refeicao[]" size="7"></td>
    </table>
    <br>
    <input class="btn" type="submit" value="Proximo" name="Proximo"> 
</form>

Hope this is what you are looking for! Hugs and good luck.

    
27.01.2017 / 02:33