Advertisement
bulfaitelo

pagina_01_02_03

Sep 13th, 2012
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.62 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  3.  
  4. <head>
  5.     <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
  6.     <meta name="author" content="BULFAITELO" />
  7.  
  8.     <title>pagina 01 02 03</title>
  9.     <link href="style123.css" rel="stylesheet" type="text/css" />
  10. </head>
  11. <?php
  12. //Declaração de variaveis
  13. $pagina = 1;    
  14. $pagina = $_POST['pagina'];
  15. $nome = $_POST['nome'];
  16. $gosta_sorvete = $_POST['gosta_sorvete'];
  17. $data = $_POST['data'];
  18. $cpf = $_POST['cpf'];
  19. $cor_favorita = $_POST['cor_favorita'];
  20. $hamb = $_POST['hamb'];
  21. $sabor = $_POST['sabor'];
  22.  
  23.  
  24.  
  25. ?>
  26.  
  27.  
  28. <body>
  29. <div class="main">
  30. <!--###############   PAGINA 01 ###############-->
  31. <?php
  32.    
  33.     if($pagina <= 1)
  34.     {
  35.    
  36.  
  37.     echo"            
  38.        <form action='pagina01_02_03.php' method='post'>
  39.        <input type='hidden' name='pagina' value='2'/>
  40.  <table border='2'>
  41.  <tr>
  42.    <th colspan='3''><h2>Pagina 01, 02, 03 em uma só</h2></th><br />
  43.  </tr>
  44.  <tr>
  45.  <td rowspan='6'>
  46.    <strong>Dados:</strong>    
  47.  </td>
  48.  <th>
  49.     <label>Nome:</label>
  50.  </th>
  51.  <th>
  52.        <input type='text' name='nome' id='lnome' value='' /><br />
  53.  </th>
  54.  </tr>
  55.  <tr>
  56.  <th>
  57.        <label> Cpf: </label>
  58.  </th>
  59.  <th>
  60.        <input type='text' name='cpf' id='lcpf' value='' /><br />
  61.  </th>  
  62.  </tr>
  63.  <tr>
  64.  <th>
  65.        <label>Data de Nasc.:</label>
  66.    </th>
  67.    <th>
  68.           <input type='text' name='data' id='ldata' value='' /><br />
  69.    </th>  
  70.  </tr>
  71.  <tr>
  72.  <th>
  73.        <label>Cor favorita:</label>
  74.  </th>
  75.   <th>
  76.            <select name='cor_favorita'>
  77.                <option>Azul</option>
  78.                <option>Amarelo</option>
  79.                <option>Verde</option>
  80.            </select>
  81.                <br />    
  82.        
  83.   </th>
  84.  </tr>
  85.  <tr>
  86.  <th>
  87.    <label>Gosta de sorvete?</label>
  88.  </th>
  89.  <th>
  90.                <label>Sim </label>    
  91.                     <input type='radio' name='gosta_sorvete' value='s' checked='checked' />
  92.                <label>Não </label>  
  93.                     <input type='radio' name='gosta_sorvete' value='n' /><br />    
  94.  </th>  
  95.  </tr>
  96.  <tr>
  97.  <th>
  98.      <input type='submit' name='enviar' value='Enviar' />
  99.  </th>
  100.  <th>
  101.       <input type='reset' name='limpar' value='Limpar' />
  102.  </th>
  103.  </tr>  
  104.        </table>
  105.       </form> ";
  106.        
  107.     }    
  108.      
  109. ?>
  110. <!--###############   PAGINA 01 ###############-->
  111.  
  112.  
  113.  
  114.  
  115. <!--###############   PAGINA 02 ###############-->
  116. <?php
  117.         if($pagina== 2)
  118.        
  119.         {
  120.            
  121.             echo
  122.             "
  123.                <form action='pagina01_02_03.php' method='post'>
  124.                <input type='hidden' name='pagina' value='3'/>
  125.                <input type='hidden' name='nome' value='$nome' />  
  126.                <input type='hidden' name='cpf' value='$cpf' />  
  127.                <input type='hidden' name='data' value='$data' / >
  128.                <input type='hidden' name='cor_favorita' value='$cor_favorita' />
  129.                <input type='hidden' name='gosta_sorvete' value='$gosta_sorvete' />
  130.                <input type='hidden' name='hamb' value='$hamb' />      
  131.                
  132.            ";
  133.            
  134.            
  135.            
  136.             if($gosta_sorvete == 's')
  137.             {
  138.                 echo
  139.                 "
  140.                    <h4> Maque os sabores preferidos: </h4>
  141.                    
  142.                    <select name='sabor[]' id='sabor' size='4' multiple='multiple' >
  143.                        <option value='Creme'>Creme</option>
  144.                        <option value='Chocolate'>Chocolate</option>
  145.                        <option value='Limão'>Limao </option>
  146.                        <option value='Laranja'>Laranja</option>                
  147.                        <option value='Creme com morango'>Creme com morango</option>
  148.                        <option value='Morango'>Morango</option>
  149.                        <option value='Uva'>Uva </option>
  150.                        <option value='Pessego'>Pessego</option>
  151.                        <option value='Pera'>Pera</option>
  152.                        <option value='Flocos'>Flocos</option>
  153.                        <option value='Pistache'>Pistache</option>
  154.                        <option value='Brigadeiro'>Brigadeiro</option>                
  155.                    </select>
  156.                    <br />
  157.                ";
  158.                
  159.                
  160.             }
  161.            
  162.             if($gosta_sorvete =='n')
  163.             {
  164.                 echo
  165.                 "
  166.                    <h4>Gosta de hanburger?</h4>
  167.    
  168.                      <input type='radio' name='hamb' value='s'/>
  169.                    <label> Sim</label>
  170.                      <input type='radio' name='hamb' value='n'/>
  171.                    <label> Não</label>
  172.                      <input type='radio' name='hamb' value='d'/>
  173.                    <label> Depende</label>  
  174.                ";
  175.                
  176.             }          
  177.  
  178.           echo
  179.           "
  180.            <br />
  181.            <input type='submit' name='enviar' value='Enviar' />
  182.            <input type='reset' name='reset' value='Limpar' />
  183.            
  184.            </form>
  185.          ";
  186.            
  187.         }
  188.  
  189.  
  190. ?>
  191. <!--###############   PAGINA 02 ###############-->        
  192.  
  193.  
  194. <!--###############   PAGINA 03 ###############-->              
  195. <?php
  196.    
  197.  
  198.    
  199.     if($pagina == 3)
  200.     {
  201.         echo
  202.         "
  203.            <h1> Concluindo ...  :) </h1>
  204.            
  205.           <b> Eu $nome, cujo o Cpf: $cpf que nasci em $data, tenho como for favorita a cor $cor_favorita ";
  206.            
  207.            
  208.              if($gosta_sorvete =='s')
  209.              {  
  210.                    
  211.                     print "e gosto de sorvete ";
  212.                    
  213.                     if(count($sabor)>$count)
  214.                     {
  215.                         print " os quais são: ";
  216.                     }
  217.                    
  218.                    
  219.                     for($cont=0;$cont<count($sabor);$cont++)
  220.                     {
  221.                        
  222.                           if($cont<(count($sabor)-1))
  223.                           {
  224.                             print($sabor[$cont]);
  225.                             echo ", ";
  226.                           }
  227.                           if(($cont+1)==count($sabor))
  228.                           {
  229.                             print "e ";
  230.                             print($sabor[$cont]);
  231.                           }
  232.                                    
  233.                     }
  234.              }
  235.              if($gosta_sorvete == 'n')
  236.              {
  237.                 print "e não gosto de sorvete  ";
  238.                
  239.                 if($hamb == 's')
  240.                 {
  241.                     print "e gosto de hanburguer ";
  242.                 }
  243.                 if($hamb == 'n')
  244.                 {
  245.                     print "e não gosto de hanburguer ";
  246.                 }
  247.                 if($hamb == 'd')
  248.                 {
  249.                     print "e depende do meu humor pra gostar de hamburguer, :)";
  250.                 }
  251.                
  252.              }
  253.        
  254.        
  255.        echo"<br /></b> " ;
  256.        
  257.          
  258.        
  259.     }
  260.  
  261. ?>          
  262. <!--###############   PAGINA 02 ###############-->  
  263.              
  264.  <!-- voltar a pagina inicial -->
  265. <br /><br /><br />
  266.                   <hr />
  267.                 <a href="../default.php"><b>pagina inicial</b></a>
  268.                 <hr />
  269. <!-- voltar a pagina inicial -->      
  270.  
  271. </div>
  272. </body>
  273. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement