-1
I’m 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 one below but in the first step of the form I work with checkbox and as I will select several of them I will have to use the implode to get all the checkbox 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;
?>
You don’t need to create N forms, just split and do as the tabs in tab. You submitted the first block, hide this one and display the next one... at the end when possible Submit, the full form will be sent.
– Papa Charlie