小编Rym*_*ymn的帖子

$ _GET数组没有传递给php

我在使用HTML表单时遇到问题,其中一个字段是多选.当我将表单作为POST提交时,一切正常,我可以看到并使用该数组.当作为GET提交时,表单的多选部分仅显示string(5) "Array".从字面上看这个词Array.我正在使用内置调试工具包中的CakePHP查看查询字符串.

这是URL

http://www.domain.com/?keywords=&location%5B%5D=12333&location%5B%5D=42123

这里的重要部分是位置数组.但是当我查看服务器变量时,它会变为:

Query String keywords=&location=Array
Run Code Online (Sandbox Code Playgroud)

这里location只打印这个单词Array.无论我尝试什么,我都无法将位置数组传递给PHP.是否有php.ini允许这样的设置?有没有其他方法可以使这项工作正常?为了保存搜索,我需要这是一个GET查询.

var_dump$_GET(非上述稍有不同的查询):

array(10) {
    ["agent"]=> string(0) ""
    ["price_min"]=> string(1) "0"
    ["price_max"]=> string(9) "987654321"
    ["beds"]=> string(0) ""
    ["baths"]=> string(0) ""
    ["mls"]=> string(0) ""
    ["pool"]=> string(1) "0"
    ["spa"]=> string(1) "0"
    ["keywords"]=> string(0) ""
    ["location"]=> string(5) "Array"
}
Run Code Online (Sandbox Code Playgroud)

html php cakephp get

0
推荐指数
1
解决办法
142
查看次数

标签 统计

cakephp ×1

get ×1

html ×1

php ×1