Insert form data in the same table

Asked

Viewed 110 times

-1

I have an extensive form so I separated the HTML and various parts but I want to continue to save in the same table.

Example:

$sqlinsert = "INSERT INTO tb_detalhe_trabalhador (Nome1, Funcao1, MedicaValidade) VALUES ('".$Nome1."','".$Funcao1."','".$MedicaValidade."')

if ($sqlinsert)
{
echo "<script>var r = confirm('Adicionar novo trabalhador?');" .
"if (r == true) {window.open('Trabalhadores2.html','_self','false');}" .
"else {window.open('Equipamentos.html','_self','false');}</script>";
 }

If the user confirms I want to insert another worker to open another form page and I want you to save

$sqlinsert = "INSERT INTO tb_detalhe_trabalhador (Nome2, Funcao2, MedicaValidade2) VALUES ('".$Nome2."','".$Funcao2."','".$MedicaValidade2."')

if ($sqlinsert)
{
echo "<script>var r = confirm('Adicionar novo trabalhador?');" .
"if (r == true) {window.open('Trabalhadores3.html','_self','false');}" .
"else {window.open('Equipamentos.html','_self','false');}</script>";
 }

It is possible to stay like this the form?

1 answer

0

Your question is not very clear, if you want to insert new users after you have done an insertion you can use Javascript even for this, you can use the location.href and everything should work normally.

If you have a form with many fields, and have separated into several files, in that case you will have to use sessões to keep the data during the pages transaction, of course you can also create fields input of the kind hidden and pass the data again.

Try to explain your problem better and ask more objective questions.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.