I can't use GET and POST at the same time in PHP

后端 未结 2 991
清酒与你
清酒与你 2020-12-21 11:44

Near the top of my page, I have this:


Then I have some form check conditionals that read from POST:

相关标签:
2条回答
  • 2020-12-21 12:12

    You can use get and post at the same time, but you shouldn't. If you want to continue to send the ID this is as simple as:

    <form ...
       <input type="submit" ...
       <input type="hidden" name="id"
          value="<?php echo htmlspecialchars($_GET['id'], ENT_QUOTES); ?>" />
    </form>
    
    0 讨论(0)
  • 2020-12-21 12:24

    Of course you can not use GET and POST methods simultaneously.

    However you can use a query string while sending a form using POST method, which being used to populate $_GET array.

    To find a certain error you have to provide more info. At least 2 things:

    • how does HTML form look
    • what do yo see in the query string after posting the form.

    and errr...

    • do you use any header redirects in the form processing?
    0 讨论(0)
提交回复
热议问题