Attribute for $_POST loses information

Asked

Viewed 44 times

0

I have an attribute called $nomeConteudo, that makes a select in my database and returns the value correctly, because through echo I confirm that the value is normal.

Within a form, I need to send this value to my formaction. By already having the value, I send it by Hidden input.

<input type="hidden" name="nomeConteudo" value=<?= $nomeConteudo ?>>

It turns out that when I get this value in my form action:

$nomeConteudo = $_POST['nomeConteudo'];

And I give a echo $nomeConteudo;, the information is reduced to only the first sentence of what I contain

For example: I have assigned the computerized value media complexity, it will only return me computerized.

I have looked for solutions and found nothing satisfactory. Someone would know what is happening?

Follow images that can help understanding... Conteudo Luiz, antes de clicar na action form (botao submeter)


Após submeter ao action form. Apenas Conteudo. Perdendo a informação "Luiz"

  • It is advisable to also send the code snippet of the sending form in which this variable is and also the code snippet of the file in which you receive this variable.

  • I switched to the variable receive locally, without being by the bank the content "Content Test", and sending to the action form it only gives the echo of "Test"

  • Try the following line: <input type="Hidden" name="setName" value=". $setName." >

  • 1

    It didn’t work, @White. That way it prints the content '.$filename. ' as if it were a string.

1 answer

0


Guys figured out the problem, I was sending the input this way:

        <input type="hidden" name="nomeConteudo" value=<?=$nomeConteudo;?> >

and the correct is this:

    <input type="hidden" name="nomeConteudo" value="<?=$nomeConteudo;?>" >

Those blessed quotes gave me a headache. But it’s there.

Browser other questions tagged

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