问题描述
我正在开发一种查询工具,该工具可显示 MySQL 数据库中的数据.用户将看到一个包含几十个动态生成的复选框的表单,以便他们可以选择如何查看数据.此数据作为 GET 请求提交,并且(显然)在请求的页面加载时显示在 url 中.
I'm working on a query tool that displays data from a MySQL database. The user is presented with a form containing a few dozen dynamically-generated checkboxes so that they can select how to view the data. This data is submitted as a GET request and is (obviously) displayed in the url when the requested page loads.
在与输入表单相同的页面上,我有一个动态生成的 php 数组,需要将其发送到与 GET 请求相同的位置.但是,我不希望此数组中的值显示在 URL 中(我在内部使用它们),因此我想将它们作为 POST 请求提交.
On the same page as the input form, I have a php array that I am generating dynamically and that needs to be sent to the same place as the GET request. However, I do not want the values in this array to be displayed in the URL (i'm using them internally) so I'd like to submit them as a POST request instead.
显然,我不能同时执行 GET 和 POST 请求.我是网络开发的新手(计算机科学方面的人,否则)并且一直在摸索如何解决这个问题.
Obviously, I can't do both a GET and POST request at the same time. I'm new to web development (computer science guy, otherwise) and have been scratching my head on how to approach this.
如果问题不明确,请告诉我.
Let me know if the problem isn't clear.
许多人建议我将它们添加到操作变量 a la:
form action="process.php?get1=value...
所有这些输入都是动态生成的,因此将它们放入操作变量中是不可行的.
推荐答案
Endophage:
如果是 PHP 数组,只需将其存储在会话中即可.
If it's a PHP array, just store it in a session.
效果很好.显然,我在这里展示了我的 Web 开发绿色,因为我并没有真正考虑使用会话.
This worked great. Obviously, I'm showing my web development greenness here as I didn't really consider using a session.
这篇关于以一种形式提交 POST 和 GET 变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!



大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)