我正在尝试获取Apply with LinkedIn插件返回的响应。我使用的是Zend框架。我已经尝试使用linkedIn中的示例代码
<?php
// access raw HTTP POST data
$post_body = file_get_contents('php://input');
$application = json_decode($post_body);
// confirm success by writing applicant name to the error log
error_log($application->person->firstName . " " . $application->person->lastName);
// now parse $application and insert data into a DB
// or perform another action
?>将此粘贴到我的控制器中,然后粘贴到我的视图中,但没有成功。
我的data-url是当前页面的url ...谁能告诉我这是怎么做的PHP或javascript (需要得到的响应进入数据库)。
谢谢。
发布于 2011-08-01 22:58:38
尝试替换
$post_body = file_get_contents('php://input');通过以下方式:
$post_body = $this->getRequest()->getRawBody(); 其中$this指的是当前请求。我不确定你是不是免费得到的,但我希望你能从这里拿到这个。我不是ZF专家。
https://stackoverflow.com/questions/6889297
复制相似问题