$_post error do not know where I’m going wrong!

Asked

Viewed 155 times

-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
  • The error suggests that you have not posted anything with the corresponding Names. can show the form ?

2 answers

0

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

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

-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>

Browser other questions tagged

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