3
Guys sorry to bother you, I’m creating a 3-step email form with 3 pages and each one is typed data in the input, I’ve already read Section tutorial and I’m not able to print at the end the data of the first and second page to send the email, what I would put on each page to keep the data ?
only the data of the third page that is the last one sent, I would like you to help me, from now, thank you !
PAGINA 1
<?php
session_start();
$nome = isset($_POST['nome']) ? $_POST['nome'] : '';
$_SESSION['nome'] = $nome;
$email = isset($_POST['email']) ? $_POST['email'] : '';
$_SESSION['conta'] = $conta;
$telefone = isset($_POST['telefone']) ? $_POST['telefone'] : '';
$_SESSION['telefone'] = $telefone;
?>
<html>
<form method="POST" action="index2.php">
<label>Nome</label>
<input type="text" name="nome" maxlength="50" />
<label>Email</label>
<input type="text" name="email" maxlength="50" />
<label>Telefone</label>
<input type="text" name="telefone" maxlength="50" />
<input type="submit" value="Submit" name="Proximo">
</form>
</html>
////
PAGINA 2
<?php
session_start();
$nome = isset($_POST['nome']) ? $_POST['nome'] : '';
$_SESSION['nome'] = $nome;
$email = isset($_POST['email']) ? $_POST['email'] : '';
$_SESSION['conta'] = $conta;
$telefone = isset($_POST['telefone']) ? $_POST['telefone'] : '';
$_SESSION['telefone'] = $telefone;
$cidade = isset($_POST['cidade']) ? $_POST['cidade'] : '';
$_SESSION['cidade'] = $cidade;
$estado = isset($_POST['estado']) ? $_POST['estado'] : '';
$_SESSION['estado'] = $estado;
?>
<html>
<form method="post" action="index3.php">
<label>Cidade</label>
<input type="text" name="cidade" maxlength="50" />
<label>Estado</label>
<input type="text" name="estado" maxlength="50" />
<input type="submit" value="Submit" name="Proximo">
</html>
//
PAGINA 3
<?php
session_start();
$nome = isset($_POST['nome']) ? $_POST['nome'] : '';
$_SESSION['nome'] = $nome;
$email = isset($_POST['email']) ? $_POST['email'] : '';
$_SESSION['conta'] = $conta;
$telefone = isset($_POST['telefone']) ? $_POST['telefone'] : '';
$_SESSION['telefone'] = $telefone;
$cidade = isset($_POST['cidade']) ? $_POST['cidade'] : '';
$_SESSION['cidade'] = $cidade;
$estado = isset($_POST['estado']) ? $_POST['estado'] : '';
$_SESSION['estado'] = $estado;
$msg = isset($_POST['msg']) ? $_POST['msg'] : '';
$_SESSION['msg'] = $msg;
?>
<html>
<form method="post" action="final.php">
<label>Mensagem</label>
<input type="text" name="msg" maxlength="50" />
<input type="submit" value="Submit" name="Enviar">
</html>
PAGINA 4
<?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;
$cidade = isset($_POST['cidade']) ? $_POST['cidade'] : '';
$_SESSION['cidade'] = $cidade;
$estado = isset($_POST['estado']) ? $_POST['estado'] : '';
$_SESSION['estado'] = $estado;
$msg = isset($_POST['msg']) ? $_POST['msg'] : '';
$_SESSION['msg'] = $msg;
?>
<html>
<label>nome: <?php echo "$nome"; ?> </label>
<label>email: <?php echo "$email"; ?> </label>
<label>telefone: <?php echo "$telefone"; ?> </label>
<label>cidade: <?php echo "$cidade"; ?> </label>
<label>estado: <?php echo "$estado"; ?> </label>
<label>mensagem: <?php echo "$msg"; ?> </label>
</html>
Glad I could help, in case you really solved your problem, mark your answer.
– Fleuquer Lima
Thank you very much, I tested here and it worked, is that I am starting now and did not know this rule... ! I was wrong here kkkk aokeoaeokae
– Leonardo Ribeiro
I marked here, very good your help, I’m learning little by little!
– Leonardo Ribeiro
Friend I would like to know how to get everything in the email, because I’m putting to send and it’s coming all the same !
– Leonardo Ribeiro
Which email? would need to see the part of the code related to the email in order to tell what happens. But if everything is coming it is not correct?
– Fleuquer Lima
is not coming to the email, because instead of printing on the page I put to reach the email... you have email, for me to send you is that I can not post the code here :P
– Leonardo Ribeiro
no need more friend, thanks for the attention, is that I had forgotten the session_start();
– Leonardo Ribeiro
@Fleuquerlima in my case I use checkbox and input and select several , how could I make a form in two step ? http://answall.com/questions/180263/como-fazer-formulario-em-etapas
– allan araujo