How to show what was selected in the post method

Asked

Viewed 135 times

0

Wanted to display on the screen what was selected by the user in the post method, how could do this.

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui this is my method ,I want to show on the screen the chosen option , as select and input Month .

<h2>Relatório de Protocolo</h2>
<br>
<form id="formBuscaProtocolo" name="" method="post" action="view/pgs/relatorios/exibiRelatorio.php" target="_blank">
    <fieldset>
        <div style="border-radius:5px;padding:10px;">
            <table class="" cellspacing='0' width='100%' border ='0'>
                <tr>
                    <td style="width: 20%">Setores:</td> 
                    <td>
                        <select style="width: 301px;" name="cadastro.cad_setor" id="cadastro.cad_setor">
                            <?php $listaDados = $Usuario->carregaSetores(); ?>
                        </select>
                    </td>
                    <td>Período:</td>
                    <td><input style="width: 296px; " name='cadastro.cad_setor' type='month'/></td>
                    <td><button id="" class="BlueButton" type="submit">Gerar Protocolo</button></td>
                </tr>
            </table>
        </div>
    </fieldset>
</form>

and this is the part I want to show what was selected in the post method , before the data coming from the database.

<?php print_r($_POST);?>
             <div>
                <table width="100%" CELLSPACING="0" CELLPADDING="2" BORDER="1" class='tabelaProt'>
                                <thead>
                                        <tr>
                                             <th>Alguma Coisa</th>
                                             <th>Alguma Coisa</th>
                                             <th>Alguma Coisa</th>
                                             <th>Alguma Coisa</th>
                                        </tr>
                                </thead>
                        <tbody>         
  <?php

            //echo "</pre>"; print_r($_indoperacional); exit;
     foreach($exibiRelatorios as $Relatorios){
          echo '<tr>';
          echo '<td align=center>'.$Relatorios.'</td>';
          echo '<td align=center>'.$Relatorios.'</td>';
          echo '<td align=center>'.$Relatorios.'</td>';
          echo '<td align=center>'.$Relatorios.'</td>';

          echo '</tr>';

        //print_r($_parametros);
     }
     ?>
  • print_r($_POST), would solve?

  • @Similar Williamaandino appears that Array ( [cadas_cad_sector] => ) and I want one of the selected sectors to appear. I updated the question.

No answers

Browser other questions tagged

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