Calling data from a form on the same HTML page

Asked

Viewed 255 times

0

I want to call data already inserted in a form and use them on the same page HTML in which I will use them in a consultation SQL. Because depending on the number of municipalities will be generated several fields IPL3. The intention is to save the data in a table in the BD. I passed at first via input "year", "month" and "Fistel" and ipl3 step "valor_ipl3_f" and "valor_ipl3_j"...and I want to use this in a query inside while!! PS.: On this page I’m developing I’ve directed via action to another page.

    <form class="form-horizontal form-label-left input_mask" name="form" id="form" action="cadastro_sici.php" method="POST" enctype="multipart/form-data" >     



      <div class="col-md-6 col-sm-6 col-xs-12 form-group has-feedback">

    <label class="col-md-3">Ano</label>
    <div class="col-md-9 col-sm-6 col-xs-6 form-group has-feedback">
     <select required name="ano" id="ano" type="text" class="form-control" maxlength="14" title="Ano do Período da Coleta"/>
                    <option value="">Selecione</option>
                    <option value="2015">2015</option>
                    <option value="2016">2016</option>
                    <option value="2017" selected="">2017</option>
                </select>
    </div>

    </div>  


      <div class="col-md-6 col-sm-6 col-xs-12 form-group has-feedback">

    <label class="col-md-3">Mês</label>
    <div class="col-md-9 col-sm-6 col-xs-6 form-group has-feedback">
    <select required name="mes" id="mes" type="text" class="form-control"  title="Mês da coleta"/>
                   <option value="">
                        Selecione
                    </option>
                    <option value="01">
                        Janeiro
                    </option>
                    <option value="02">
                        Fevereiro
                    </option>
                    <option value="03">
                        Março
                    </option>
                    <option value="04">
                        Abril
                    </option>
                    <option value="05">
                        Maio
                    </option>
                    <option value="06">
                        Junho
                    </option>
                    <option value="07">
                        Julho
                    </option>
                    <option value="08">
                        Agosto
                    </option>
                    <option value="09">
                        Setembro
                    </option>
                    <option value="10" selected>
                        Outubro
                    </option>
                    <option value="11">
                        Novembro
                    </option>
                    <option value="12">
                        Dezembro
                    </option>
                </select>

    </div>

    </div> 







       <div class="col-md-6 col-sm-6 col-xs-12 form-group has-feedback">        
    <label class="col-md-3">Fistel</label>
    <div class="col-md-9 col-sm-6 col-xs-6 form-group has-feedback">
    <input name="fistel" id="fistel" type="text" class="form-control col-md-4 col-sm-4 col-xs-12"  maxlength="11" size="11" title="Número do Fistel" required/>   
    </div>

    </div> 

       <div class="col-md-6 col-sm-6 col-xs-12 form-group has-feedback">        
    <label class="col-md-3">Número</label>
    <div class="col-md-9 col-sm-6 col-xs-6 form-group has-feedback">
    <input name="IAU1" id="IAU1" type="text" class="form-control" maxlength="19" size="19" maxlength="15" title="IAU1 Número de Centro de Atendimento Telefônico" />  
    </div>

    </div> 

....

       <?php    

       while($dado_ipl3 = mysqli_fetch_array($qry_ipl3)) { 

        $nome_municipio = $dado_ipl3['CIDADE'];
       $codmunicipio = $dado_ipl3['COD_CIDADE'];











     $sql3 = "INSERT INTO financeiro_sici_anatel_ipl3 (ano, mes, fistel,codmunicipio, IPL3_valor_F, IPL3_valor_J)

       VALUES ('$ano_upload', '$mes_uplooad', '$fistel','$codmunicipio', '$valor_ipl3_f', '$valor_ipl3_j')"; 




    $resultado3 = $banco->pesquisarBD($sql3);

      ?>

     <div class="col-md-6 col-sm-6 col-xs-12 form-group has-feedback">


     <div class="container">


     <div class="row">       
     <label class="col-md-3">IPL3 Distribuição do quantitativo total de acessos fisícos em serviço por tipo de usuário</label>                       
    </div>


     <div class="row">
     <div class="col-md-6 col-sm-6 col-xs-12 form-group has-feedback">        
    <label class="col-md-3">Nome Município</label>
    <div class="col-md-9 col-sm-6 col-xs-6 form-group has-feedback">
    <input type="text" name="nome_municipio" id="nome_municipio" 
     class="form-control" value="<?php echo"$nome_municipio" ?>"   
       maxlength="18" size="18" title="Nome Município">
    </div>                       
    </div> 
      </div>


    <div class="row">
    <div class="col-md-6 col-sm-6 col-xs-12 form-group has-feedback">        
    <label class="col-md-3">Codigo Municipio</label>
    <div class="col-md-9 col-sm-6 col-xs-6 form-group has-feedback">
    <input type="text" name="codmunicipio" id="codmunicipio" class="form-
       control numero_livre" value="<?php echo $codmunicipio; ?>"  
     maxlength="7" size="7">
    </div>                       
    </div> 
    </div>


     <div class="row">
     <div class="col-md-6 col-sm-6 col-xs-12 form-group has-feedback">        
    <label class="col-md-3">Acesso físico P.F.</label>
    <div class="col-md-9 col-sm-6 col-xs-6 form-group has-feedback">
    <input type="text" name="IPL3_valor_F" id="IPL3_valor_F" class="form-
    control numero" value="0"   maxlength="18" size="18" title="Quantitativo 
      de Acesso físico em serviço pelo tipo da Pessoa Física">
    </div>                       
    </div> 
     </div>

    <div class="row">
    <div class="col-md-6 col-sm-6 col-xs-12 form-group has-feedback">        
    <label class="col-md-3">Acesso físico P.J.</label>
    <div class="col-md-9 col-sm-6 col-xs-6 form-group has-feedback">
   <input type="text" name="IPL3_valor_J" id="IPL3_valor_J" class="form-
  control numero" value="0"  maxlength="18" size="18" title="Quantitativo de 
     Acesso físico em serviço pelo tipo da Pessoa Jurídica">
    </div>                       
    </div> 
   </div>

     <div class="row">
     <div class="col-md-6 col-sm-6 col-xs-12 form-group has-feedback">        
    <label class="col-md-3">Crescimento Anual Terceiros</label>
    <div class="col-md-9 col-sm-6 col-xs-6 form-group has-feedback">
   <input type="text"  value="0,00" class="form-control decimal" 
   name="IPL1_d" id="IPL1_d" maxlength="21" size="21" title="Crescimento 
     anual previsto em quilômetros de cabo da rede de fibra óptica de 
     propriedade de terceiros. Obrigatório ser decimal. Ex: (0,00)">
    </div>                       
    </div> 
    </div>

   </div>
     </div>


   <?php   

    }

    ?>
  • Good afternoon, post your code so we can help, there are some ways to do this

  • I couldn’t understand anything.

  • It’s really quite complicated to understand. I recommend you edit by rephrasing your question...

No answers

Browser other questions tagged

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