Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/43.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从iphone应用程序中的表单到Get方法中的php web应用程序获取值?_Php_Iphone_Forms_Zend Framework_Get - Fatal编程技术网

从iphone应用程序中的表单到Get方法中的php web应用程序获取值?

从iphone应用程序中的表单到Get方法中的php web应用程序获取值?,php,iphone,forms,zend-framework,get,Php,Iphone,Forms,Zend Framework,Get,我试图在zend框架中获取表单的请求值 早些时候,我使用的是post方法 但是iphone应用程序正在用get方法向我发送数据 我如何使用它呢?我使用的是post值 $post=数组( 'id'=>'2', 'email'=>'4', ) 我还希望在提交表单时获取表单值中的值 我用这个来获取post值 $post = $this->getRequest ()->getPost (); 我试着得到方法值 $post = $this->getRequest()

我试图在zend框架中获取表单的请求值

早些时候,我使用的是post方法

但是iphone应用程序正在用get方法向我发送数据

我如何使用它呢?我使用的是post值

$post=数组( 'id'=>'2', 'email'=>'4', )

我还希望在提交表单时获取表单值中的值

我用这个来获取post值

      $post = $this->getRequest ()->getPost ();
我试着得到方法值

    $post = $this->getRequest();
但是

我得到这个错误 无法将Zend\u Controller\u Request\u Http类型的对象用作中的数组

这是完整的错误消息

“Zend_控制器_请求_Http对象([\u参数源:受保护]=> 数组([0]=>\u获取[1]=>\u发布)[\u请求URI:受保护]=> /白金精选/p精选/索引/注册[\u baseUrl:受保护]=> /白金拾取/p拾取[\u基本路径:受保护]=>[\u路径信息:受保护] =>/index/registration[\u参数:受保护]=>Array([controller]=>index[action]=>registration[module]=>default) [\u rawBody:protected]=>[\u别名:protected]=>数组() [\u已调度:受保护]=>1[\u模块:受保护]=>默认值 [\u moduleKey:protected]=>模块[\u控制器:protected]=>索引 [\u controllerKey:protected]=>controller[\u action:protected]=> 注册[\u actionKey:protected]=>操作)致命错误:无法 将Zend\u Controller\u Request\u Http类型的对象用作D:\Program中的数组 Files\Zend\Apache2\htdocs\platinum picks\application\models\User.php 在线267“


您可以使用以下示例查找
GET
变量:

$this->getRequest()->getParams();
或者,对于特定变量:

$this->getRequest()->getParam('myVar');
这也将搜索
POST
值。要搜索
GET
vars only,请使用:

$this->getRequest()->getQuery('myVar');

如果我理解正确,您希望使用get方法获得传递的值,并且您已经成功地使用POST值实现了同样的操作。在这种情况下,您需要做的唯一更改是:

$post = $this->getRequest()->getPost ();
变成

$get = $this->getRequest()->getParams();
这也将从其他来源返回参数:

检索合并的参数数组,其优先级为userland参数(请参见setParam())、$\u GET、$\u POST(即,userland参数中的值将优先于所有其他参数)

因此,如果这可能是您的问题,请参阅手册