【发布时间】:2015-08-15 07:55:21
【问题描述】:
我有一个通用控制器,它将获得POST 请求并决定调用任何控制器的已知方法。控制器将根据要求选择。
我还需要将整个POST 请求发送到所选方法而不被篡改。
更多说明
在controller 1 中获取post 请求,处理请求并决定调用controller X | X != 1 的known_method()。还将主要请求发送到该方法。例如。
public function index()
{
$post = $this->input->post();
//handling the request and decide to call the following method of another controller
Controller_X->known_method($post);
//OR
redirect("site_url/controller_X/known_method/{$post}");
}
但是因为发送$post作为参数,它会作为GET请求发送,可能会篡改它的数据,这是不实用的方法。还存储在session 中并在目标方法中检索它不是一个好的解决方案。
问题:如何将这些数据发送到我选择的目标?
提前致谢
【问题讨论】:
标签: php codeigniter post parameters