Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
- <meta name="author" content="BULFAITELO" />
- <title>pagina 01 02 03</title>
- <link href="style123.css" rel="stylesheet" type="text/css" />
- </head>
- <?php
- //Declaração de variaveis
- $pagina = 1;
- $pagina = $_POST['pagina'];
- $nome = $_POST['nome'];
- $gosta_sorvete = $_POST['gosta_sorvete'];
- $data = $_POST['data'];
- $cpf = $_POST['cpf'];
- $cor_favorita = $_POST['cor_favorita'];
- $hamb = $_POST['hamb'];
- $sabor = $_POST['sabor'];
- ?>
- <body>
- <div class="main">
- <!--############### PAGINA 01 ###############-->
- <?php
- if($pagina <= 1)
- {
- echo"
- <form action='pagina01_02_03.php' method='post'>
- <input type='hidden' name='pagina' value='2'/>
- <table border='2'>
- <tr>
- <th colspan='3''><h2>Pagina 01, 02, 03 em uma só</h2></th><br />
- </tr>
- <tr>
- <td rowspan='6'>
- <strong>Dados:</strong>
- </td>
- <th>
- <label>Nome:</label>
- </th>
- <th>
- <input type='text' name='nome' id='lnome' value='' /><br />
- </th>
- </tr>
- <tr>
- <th>
- <label> Cpf: </label>
- </th>
- <th>
- <input type='text' name='cpf' id='lcpf' value='' /><br />
- </th>
- </tr>
- <tr>
- <th>
- <label>Data de Nasc.:</label>
- </th>
- <th>
- <input type='text' name='data' id='ldata' value='' /><br />
- </th>
- </tr>
- <tr>
- <th>
- <label>Cor favorita:</label>
- </th>
- <th>
- <select name='cor_favorita'>
- <option>Azul</option>
- <option>Amarelo</option>
- <option>Verde</option>
- </select>
- <br />
- </th>
- </tr>
- <tr>
- <th>
- <label>Gosta de sorvete?</label>
- </th>
- <th>
- <label>Sim </label>
- <input type='radio' name='gosta_sorvete' value='s' checked='checked' />
- <label>Não </label>
- <input type='radio' name='gosta_sorvete' value='n' /><br />
- </th>
- </tr>
- <tr>
- <th>
- <input type='submit' name='enviar' value='Enviar' />
- </th>
- <th>
- <input type='reset' name='limpar' value='Limpar' />
- </th>
- </tr>
- </table>
- </form> ";
- }
- ?>
- <!--############### PAGINA 01 ###############-->
- <!--############### PAGINA 02 ###############-->
- <?php
- if($pagina== 2)
- {
- echo
- "
- <form action='pagina01_02_03.php' method='post'>
- <input type='hidden' name='pagina' value='3'/>
- <input type='hidden' name='nome' value='$nome' />
- <input type='hidden' name='cpf' value='$cpf' />
- <input type='hidden' name='data' value='$data' / >
- <input type='hidden' name='cor_favorita' value='$cor_favorita' />
- <input type='hidden' name='gosta_sorvete' value='$gosta_sorvete' />
- <input type='hidden' name='hamb' value='$hamb' />
- ";
- if($gosta_sorvete == 's')
- {
- echo
- "
- <h4> Maque os sabores preferidos: </h4>
- <select name='sabor[]' id='sabor' size='4' multiple='multiple' >
- <option value='Creme'>Creme</option>
- <option value='Chocolate'>Chocolate</option>
- <option value='Limão'>Limao </option>
- <option value='Laranja'>Laranja</option>
- <option value='Creme com morango'>Creme com morango</option>
- <option value='Morango'>Morango</option>
- <option value='Uva'>Uva </option>
- <option value='Pessego'>Pessego</option>
- <option value='Pera'>Pera</option>
- <option value='Flocos'>Flocos</option>
- <option value='Pistache'>Pistache</option>
- <option value='Brigadeiro'>Brigadeiro</option>
- </select>
- <br />
- ";
- }
- if($gosta_sorvete =='n')
- {
- echo
- "
- <h4>Gosta de hanburger?</h4>
- <input type='radio' name='hamb' value='s'/>
- <label> Sim</label>
- <input type='radio' name='hamb' value='n'/>
- <label> Não</label>
- <input type='radio' name='hamb' value='d'/>
- <label> Depende</label>
- ";
- }
- echo
- "
- <br />
- <input type='submit' name='enviar' value='Enviar' />
- <input type='reset' name='reset' value='Limpar' />
- </form>
- ";
- }
- ?>
- <!--############### PAGINA 02 ###############-->
- <!--############### PAGINA 03 ###############-->
- <?php
- if($pagina == 3)
- {
- echo
- "
- <h1> Concluindo ... :) </h1>
- <b> Eu $nome, cujo o Cpf: $cpf que nasci em $data, tenho como for favorita a cor $cor_favorita ";
- if($gosta_sorvete =='s')
- {
- print "e gosto de sorvete ";
- if(count($sabor)>$count)
- {
- print " os quais são: ";
- }
- for($cont=0;$cont<count($sabor);$cont++)
- {
- if($cont<(count($sabor)-1))
- {
- print($sabor[$cont]);
- echo ", ";
- }
- if(($cont+1)==count($sabor))
- {
- print "e ";
- print($sabor[$cont]);
- }
- }
- }
- if($gosta_sorvete == 'n')
- {
- print "e não gosto de sorvete ";
- if($hamb == 's')
- {
- print "e gosto de hanburguer ";
- }
- if($hamb == 'n')
- {
- print "e não gosto de hanburguer ";
- }
- if($hamb == 'd')
- {
- print "e depende do meu humor pra gostar de hamburguer, :)";
- }
- }
- echo"<br /></b> " ;
- }
- ?>
- <!--############### PAGINA 02 ###############-->
- <!-- voltar a pagina inicial -->
- <br /><br /><br />
- <hr />
- <a href="../default.php"><b>pagina inicial</b></a>
- <hr />
- <!-- voltar a pagina inicial -->
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement