Form does not send all variables by POST

Asked

Viewed 685 times

3

I am a beginner in PHP and created a form, and when I submit it by POST, only two variables (DESCRICAO and CODIGO) are being sent, the rest are blank. What is the error in this code?

<form action="../function/func_inserir.php" id="inserir_C" name="inserir_C"
    onsubmit="return validateForm()" method="POST">
<p style="margin-left:200px"><b>Descrição:</b>
<input type="text" name="DESCRICAO" MAXLENGTH="100" size="50" value="" />
<div id="Produto">
<p id="TABELAS"><b>PRODUTO</b></p>
<table id="TABELAS" >
 <tr>
   <th>Código do Produto:</th>
   <td>
      <input type="text" name="CODIGO" MAXLENGTH="13" size="11" value="" onkeypress="return Only_N(event)"/>
  </td>
  <th>Acabamento:</th>
  <td>
   <?php 
       $rs = mysql_query("SELECT ACABPK,DESCRICAO FROM dober.acabamento ORDER BY FAT"); 
       montaCombo('AC_cmb', $rs, 'ACABPK', 'DESCRICAO');
   ?>
   </td>
 </tr>
 <tr>
    <th>Peso Bruto:</th>
    <td>
       <input type="text" name="PBRT" MAXLENGTH="7"  size="11" value="" onkeypress="return validate_P(event)"/>
    </td>
    <th> Tratamento Térmico:</th>
    <td>
    <?php 
        $rs = mysql_query("SELECT TRAT_TERMPK,DESCRICAO FROM dober.tratamento_termico ORDER BY DESCRICAO"); 
        montaCombo('TT_cmb', $rs, 'TRAT_TERMPK', 'DESCRICAO');
    ?>
    </td>
 </tr>
 <tr>
   <th>Peso Liquido:</th>
   <td>
      <input type="text" name="PLIQ" MAXLENGTH="7"  size="11" value="" onkeypress="return validate_P(event)"/>
   </td>
 </tr>
</table>
</div><!-- end of div produto -->

<div>               
<button type="submit" id="cadastra" class="btnCD">CADASTRAR</button>
<input type="hidden" name="OPCAO" value="insert" />
</div>

</form> 
  • put the code of your ../function/func_inserir.php

  • Hello friend post the file you receive the form

1 answer

1


I created the following page func_inserir.php and worked for this variable:

<?php

$a = $_REQUEST['PLIQ'];

print $a;

Tries to capture values via $_REQUEST.

  • Gustavo, thanks for the answer, was using str_replace to replace blank values on the variable, so everything was going blank, even $_POST with value, it was blank. Below is an example of how you were using:$MQ2 = str_replace($_POST['Mq_cmb2'],''99');

Browser other questions tagged

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