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

邮差的信 提交于 2019-11-29 16:19:22
Explosion Pills

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>

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?
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!