将从一个服务器检索的值传递给PHP中的另一个服务器

时间:2015-02-02 07:33:23

标签: php redirect

我在PHP zend框架中工作。我有一个api函数如下。

http://testmywebsite/API/Testmyapifunction

我已经把我的api url给了我的一个客户。他们有一个设置,当他们发送短信时,我的api url被拒绝了。他们正在推送消息的内容,id,时间的详细信息我可以在api函数中获取详细信息。

我按以下方式获取详细信息。

$ msg_id = $ this-> _getParam(' msg_id');

$ msg_senderid = $ this-> _getParam(' msg_senderid');

$ msg_content = $ this-> _getParam(' msg_content');

我将这些值存储在我的db中。然后我想将这些值传递给另一台服务器。我有该服务器的api url。但是我无法将值传递给该服务器。

我按以下方式重定向值。

$ this-> _redirect(' http://testanotherwebsite/API/Testapifunction.aspx?msg_id='。$ msg_id。'& msg_senderid ='。$ msg_senderid。'& msg_content =' $ msg_content);

我想将这些值传递给另一台服务器。有人请帮助我。我正在处理这个问题多天,今天是我的截止日期。请帮忙。

1 个答案:

答案 0 :(得分:0)

我不是zend框架的专家,但是这样读过:

$this->redirect('/module/controller/action/username/robin/email/robin@example.com');

您也可以尝试重定向器:

$params = array('user' => $user, 'mail' => $mail);
$this->_helper->redirector($action, $controller, $module, $params);

源:

Zend: Redirect to Action with parameters