$ _post error I do not know where I'm going wrong! [duplicate]

-4

$cpfcnpj_tomador = $_POST['txtCpfCnpjTomador']; $numero_rps = $_POST['txtRpsNumero']; $data_rps = $_POST['txtDataRps']; $valor_rps = $_POST['txtValorRps']; $cpfcnpj_prestador = $_POST['txtCpfCnpjPrestador']; $email_tomador = $_POST['txtEmailtomador']; $especificacao = $_POST['cmbEspecificacao']; $descricao = $_POST['txtDescricao'];

ERROR:

( ! ) Notice: Undefined index: txtCpfCnpjTomador in C:\wamp64\www\enota\site\inc\ouvidoria\cadastro.php on line 22 Call Stack
#   Time    Memory  Function    Location 1  0.0010  251048  {main}( )   ...\cadastro.php:0

( ! ) Notice: Undefined index: txtRpsNumero in C:\wamp64\www\enota\site\inc\ouvidoria\cadastro.php on line 23 Call Stack
#   Time    Memory  Function    Location 1  0.0010  251048  {main}( )   ...\cadastro.php:0

( ! ) Notice: Undefined index: txtDataRps in C:\wamp64\www\enota\site\inc\ouvidoria\cadastro.php on line 24 Call Stack
#   Time    Memory  Function    Location 1  0.0010  251048  {main}( )   ...\cadastro.php:0

( ! ) Notice: Undefined index: txtValorRps in C:\wamp64\www\enota\site\inc\ouvidoria\cadastro.php on line 25 Call Stack
#   Time    Memory  Function    Location 1  0.0010  251048  {main}( )   ...\cadastro.php:0

( ! ) Notice: Undefined index: txtCpfCnpjPrestador in C:\wamp64\www\enota\site\inc\ouvidoria\cadastro.php on line 26 Call Stack
#   Time    Memory  Function    Location 1  0.0010  251048  {main}( )   ...\cadastro.php:0

( ! ) Notice: Undefined index: txtEmailtomador in C:\wamp64\www\enota\site\inc\ouvidoria\cadastro.php on line 27 Call Stack
#   Time    Memory  Function    Location 1  0.0010  251048  {main}( )   ...\cadastro.php:0

( ! ) Notice: Undefined index: cmbEspecificacao in C:\wamp64\www\enota\site\inc\ouvidoria\cadastro.php on line 28 Call Stack
#   Time    Memory  Function    Location 1  0.0010  251048  {main}( )   ...\cadastro.php:0

( ! ) Notice: Undefined index: txtDescricao in C:\wamp64\www\enota\site\inc\ouvidoria\cadastro.php on line 29 Call Stack
#   Time    Memory  Function    Location 1  0.0010  251048  {main}( )   ...\cadastro.php:0

( ! ) Notice: Undefined index: btCadastrar in C:\wamp64\www\enota\site\inc\ouvidoria\cadastro.php on line 32 Call Stack
#   Time    Memory  Function    Location 1  0.0010  251048  {main}( )   ...\cadastro.php:0
    
asked by anonymous 08.07.2016 / 21:53

2 answers

0

The variables $_POST are not defined, check your form if the action and method are informed. Example:

<form method="post" action="cadastro.php"> ... </form>

    
08.07.2016 / 22:10
-3

In this case your form should look something like this:

label{min-width: 135px;display: inline-table;}
<form action="cadastro.php" method="POST">
    <label for="txtCpfCnpjTomador">txtCpfCnpjTomador</label>
    <input type="text" name="txtCpfCnpjTomador" id="txtCpfCnpjTomador">
    <br><br>
    <label for="txtRpsNumero">txtRpsNumero</label>
    <input type="text" name="txtRpsNumero" id="txtRpsNumero">
    <br><br>
    <label for="txtDataRps">txtDataRps</label>
    <input type="text" name="txtDataRps" id="txtDataRps">
    <br><br>
    <label for="txtValorRps">txtValorRps</label>
    <input type="text" name="txtValorRps" id="txtValorRps">
    <br><br>
    <label for="txtCpfCnpjPrestador">txtCpfCnpjPrestador</label>
    <input type="text" name="txtCpfCnpjPrestador" id="txtCpfCnpjPrestador">
    <br><br>
    <label for="txtEmailtomador">txtEmailtomador</label>
    <input type="text" name="txtEmailtomador" id="txtEmailtomador">
    <br><br>
    <label for="cmbEspecificacao">cmbEspecificacao</label>
    <input type="text" name="cmbEspecificacao" id="cmbEspecificacao">
    <br><br>
    <label for="txtDescricao">txtDescricao</label>
    <input type="text" name="txtDescricao" id="txtDescricao">
    <br><br>
    <button>Enviar</button>
</form>
    
08.07.2016 / 22:15