$_POST, $_GET and $_REQUEST Empty

前端 未结 1 1074
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-29 09:53

SOLVED: I omitted the name attribute on the input fields. I have a simple html/php -form. And I submit it. The $_POST is always empty. If I try a get then the

相关标签:
1条回答
  • 2021-01-29 10:19

    Do all your form input fields have a name attribute or just an id attribute? It might be as simple as adding a name attribute to each input field.

    <input type="text" id="afield" value="a value">
    

    Is not the same as

    <input type="text" id="afield" name="afield" value="a value">
    

    $_POST['afield'] should only return a value with the second example above

    0 讨论(0)
提交回复
热议问题