Form does not pass data via POST

Asked

Viewed 1,626 times

1

I have the following excerpt:

<html>
<form name="sai_frm_incl_patr" method="post" action="sai_incl_peri_seri_patr.php">
    <body>  
    <table border="0" width="100%">
        <tr>
            <td colspan="3" bgcolor="Silver" align="center">    
            <b><font face="arial" color="blue" size="2">Inclusão de Patrimônio e serial</font>
            </td>
        </tr>
        <tr>
            <td>
                <input type="hidden" id="id_pat" name="w_patr_seri"  value="aaaaa">                 
            </td>
        </tr>
    </table>
</body>
</form>
</html>

And on the page that’s getting the data I do it:

<?php
$w_patr = trim($_POST['w_patr_seri']); 
?>

But the variable contains no content! What must be the error? Or what am I doing wrong?'

  • @Tiagosilva, I tried that way but it still doesn’t work =/

  • Dude, how are you sending this form??? from what I’ve seen, you don’t have any Ubmit for this form, and its input is Hidden... already looked if the data is being sent by firebug?

1 answer

5

You opened and closed the form outside the body

    <html>
       <body>
            <form name="sai_frm_incl_patr" method="post" action="sai_incl_peri_seri_patr.php"> 
            <table border="0" width="100%">
                <tr>
                    <td colspan="3" bgcolor="Silver" align="center">    
                    <b><font face="arial" color="blue" size="2">Inclusão de Patrimônio e serial</font>
                    </td>
                </tr>
                <tr>
                    <td>
                        <input type="hidden" id="id_pat" name="w_patr_seri"  value="aaaaa">                 
                    </td>
                </tr>
            </table>
            </form>
        </body>   
    </html>
  • 1

    Really @Marcosvinicius I was opening and closing the wrong form'. But still he does not recognize the post in the next program!

  • That one POST has to be fired from a button, you did not put in this form a button, as it is sending POST?

  • I did not put in the example I put here in!

  • 2

    Reset the complete form as updated at the bottom of your initial question without misleading what you have already put. So we can come to an answer.

Browser other questions tagged

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